Ver código fonte

perf: 历史处方查询优化

zhengjie 1 ano atrás
pai
commit
95679522b1

+ 9 - 3
Business/HisMainBusiness.cs

@@ -1924,18 +1924,24 @@ namespace PTMedicalInsurance.Business
             input.certno = certNo;
             input.chfpdr_code = doctorCode;
             input.mdtrt_id = mdtrt_id;
+            input.hilist_code = "";
+            input.hilist_name = "";
+            input.hilist_type = "";
+
+            dynamic inParam = new JObject();
+            inParam.data = input;
 
             JArray joOutput = new JArray();
             string errMsg = "";
             try
             {
-                JObject joRtn = invoker.invokeCenterService(TradeEnum.HistoryPrescriptionQuery, input);
+                JObject joRtn = invoker.invokeCenterService(TradeEnum.HistoryPrescriptionQuery, inParam);
                 if (JsonHelper.parseCenterRtnValue(joRtn, out errMsg) != 0)
                 {
-                    Global.writeLog("QueryPatientPrescription", input.ToString(), errMsg);
+                    Global.writeLog("QueryPatientPrescription", inParam.ToString(), errMsg);
                     return joOutput;
                 }
-                joOutput = JArray.Parse(joRtn["mdtrtinfo"].Text());
+                joOutput = JArray.Parse(JsonHelper.getDestValue(joRtn,"output.feelistinfo"));
             }
             catch (Exception ex)
             {

+ 16 - 0
FormSetter/GridViewSetter.cs

@@ -962,6 +962,22 @@ namespace PTMedicalInsurance.FormSetter
             dgv.RowHeadersVisible = true;
         }
 
+        public void SetHeaderTextOfHistoryAdmInfo(DataGridView dgv)
+        {
+            dgv.AutoGenerateColumns = false;
+            dgv.Columns.Clear();
+
+            AddDGVColumn(dgv, "姓名", "PatientName", 200);
+            AddDGVColumn(dgv, "性别", "Gend", 150);
+            AddDGVColumn(dgv, "身份证号", "PsnCertNO", 200);
+            AddDGVColumn(dgv, "医生姓名", "ChiefPhyDocName", 120);
+            AddDGVColumn(dgv, "医生编码", "AttendDoctorNO", 120);
+            AddDGVColumn(dgv, "就诊ID", "MdtrtID", 150);
+            AddDGVColumn(dgv, "就诊日期", "RegDate", 200);
+
+            dgv.RowHeadersVisible = true;
+        }
+
         #endregion
 
     }

+ 151 - 85
Forms/PrescriptionForm.Designer.cs

@@ -29,11 +29,16 @@ namespace PTMedicalInsurance.Forms
         /// </summary>
         private void InitializeComponent()
         {
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle();
             this.txtNo = new Sunny.UI.UITextBox();
             this.txtName = new Sunny.UI.UITextBox();
             this.uiLabel2 = new Sunny.UI.UILabel();
@@ -41,19 +46,21 @@ namespace PTMedicalInsurance.Forms
             this.dgvHistory = new Sunny.UI.UIDataGridView();
             this.uiPanel1 = new Sunny.UI.UIPanel();
             this.btnQuery = new System.Windows.Forms.Button();
-            this.uiLabel3 = new Sunny.UI.UILabel();
-            this.txtAdmID = new Sunny.UI.UITextBox();
-            this.uiLabel4 = new Sunny.UI.UILabel();
             this.txtDoctorNo = new Sunny.UI.UITextBox();
+            this.uiLabel4 = new Sunny.UI.UILabel();
+            this.txtAdmID = new Sunny.UI.UITextBox();
+            this.uiLabel3 = new Sunny.UI.UILabel();
+            this.dgvAdm = new Sunny.UI.UIDataGridView();
             ((System.ComponentModel.ISupportInitialize)(this.dgvHistory)).BeginInit();
             this.uiPanel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dgvAdm)).BeginInit();
             this.SuspendLayout();
             // 
             // txtNo
             // 
             this.txtNo.Cursor = System.Windows.Forms.Cursors.IBeam;
             this.txtNo.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtNo.Location = new System.Drawing.Point(477, 29);
+            this.txtNo.Location = new System.Drawing.Point(421, 26);
             this.txtNo.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.txtNo.MinimumSize = new System.Drawing.Size(1, 16);
             this.txtNo.Name = "txtNo";
@@ -67,7 +74,7 @@ namespace PTMedicalInsurance.Forms
             // 
             this.txtName.Cursor = System.Windows.Forms.Cursors.IBeam;
             this.txtName.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtName.Location = new System.Drawing.Point(159, 29);
+            this.txtName.Location = new System.Drawing.Point(127, 26);
             this.txtName.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.txtName.MinimumSize = new System.Drawing.Size(1, 16);
             this.txtName.Name = "txtName";
@@ -80,9 +87,9 @@ namespace PTMedicalInsurance.Forms
             // uiLabel2
             // 
             this.uiLabel2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.uiLabel2.Location = new System.Drawing.Point(325, 29);
+            this.uiLabel2.Location = new System.Drawing.Point(301, 26);
             this.uiLabel2.Name = "uiLabel2";
-            this.uiLabel2.Size = new System.Drawing.Size(130, 33);
+            this.uiLabel2.Size = new System.Drawing.Size(113, 33);
             this.uiLabel2.TabIndex = 15;
             this.uiLabel2.Text = "身份证号码";
             this.uiLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
@@ -91,9 +98,9 @@ namespace PTMedicalInsurance.Forms
             // uiLabel1
             // 
             this.uiLabel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.uiLabel1.Location = new System.Drawing.Point(12, 30);
+            this.uiLabel1.Location = new System.Drawing.Point(12, 26);
             this.uiLabel1.Name = "uiLabel1";
-            this.uiLabel1.Size = new System.Drawing.Size(131, 33);
+            this.uiLabel1.Size = new System.Drawing.Size(108, 33);
             this.uiLabel1.TabIndex = 14;
             this.uiLabel1.Text = "病人姓名:";
             this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.TopRight;
@@ -102,52 +109,53 @@ namespace PTMedicalInsurance.Forms
             // dgvHistory
             // 
             this.dgvHistory.AllowUserToAddRows = false;
-            dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
-            this.dgvHistory.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
+            dataGridViewCellStyle11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
+            this.dgvHistory.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11;
             this.dgvHistory.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
             this.dgvHistory.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
-            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
-            dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle2.ForeColor = System.Drawing.Color.White;
-            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
-            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
-            this.dgvHistory.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
+            dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            dataGridViewCellStyle12.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
+            dataGridViewCellStyle12.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle12.ForeColor = System.Drawing.Color.White;
+            dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
+            dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.dgvHistory.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12;
             this.dgvHistory.ColumnHeadersHeight = 32;
             this.dgvHistory.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
-            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle3.BackColor = System.Drawing.Color.White;
-            dataGridViewCellStyle3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
-            dataGridViewCellStyle3.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255)))));
-            dataGridViewCellStyle3.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
-            dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.dgvHistory.DefaultCellStyle = dataGridViewCellStyle3;
-            this.dgvHistory.Dock = System.Windows.Forms.DockStyle.Fill;
+            dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle13.BackColor = System.Drawing.Color.White;
+            dataGridViewCellStyle13.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle13.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
+            dataGridViewCellStyle13.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255)))));
+            dataGridViewCellStyle13.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
+            dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.dgvHistory.DefaultCellStyle = dataGridViewCellStyle13;
+            this.dgvHistory.Dock = System.Windows.Forms.DockStyle.Bottom;
             this.dgvHistory.EnableHeadersVisualStyles = false;
             this.dgvHistory.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.dgvHistory.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(173)))), ((int)(((byte)(255)))));
-            this.dgvHistory.Location = new System.Drawing.Point(0, 0);
+            this.dgvHistory.Location = new System.Drawing.Point(0, 297);
+            this.dgvHistory.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.dgvHistory.Name = "dgvHistory";
-            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
-            dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
-            dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
-            dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
-            dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
-            this.dgvHistory.RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
+            dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
+            dataGridViewCellStyle14.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle14.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
+            dataGridViewCellStyle14.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
+            dataGridViewCellStyle14.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
+            dataGridViewCellStyle14.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.dgvHistory.RowHeadersDefaultCellStyle = dataGridViewCellStyle14;
             this.dgvHistory.RowHeadersWidth = 62;
-            dataGridViewCellStyle5.BackColor = System.Drawing.Color.White;
-            dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
-            dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255)))));
-            dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
-            this.dgvHistory.RowsDefaultCellStyle = dataGridViewCellStyle5;
+            dataGridViewCellStyle15.BackColor = System.Drawing.Color.White;
+            dataGridViewCellStyle15.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle15.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
+            dataGridViewCellStyle15.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255)))));
+            dataGridViewCellStyle15.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
+            this.dgvHistory.RowsDefaultCellStyle = dataGridViewCellStyle15;
             this.dgvHistory.RowTemplate.Height = 23;
             this.dgvHistory.SelectedIndex = -1;
-            this.dgvHistory.Size = new System.Drawing.Size(1465, 555);
+            this.dgvHistory.Size = new System.Drawing.Size(1824, 432);
             this.dgvHistory.TabIndex = 18;
             this.dgvHistory.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
             // 
@@ -165,10 +173,10 @@ namespace PTMedicalInsurance.Forms
             this.uiPanel1.Dock = System.Windows.Forms.DockStyle.Top;
             this.uiPanel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.uiPanel1.Location = new System.Drawing.Point(0, 0);
-            this.uiPanel1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.uiPanel1.Margin = new System.Windows.Forms.Padding(4);
             this.uiPanel1.MinimumSize = new System.Drawing.Size(1, 1);
             this.uiPanel1.Name = "uiPanel1";
-            this.uiPanel1.Size = new System.Drawing.Size(1465, 92);
+            this.uiPanel1.Size = new System.Drawing.Size(1824, 87);
             this.uiPanel1.TabIndex = 19;
             this.uiPanel1.Text = null;
             this.uiPanel1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
@@ -176,7 +184,7 @@ namespace PTMedicalInsurance.Forms
             // 
             // btnQuery
             // 
-            this.btnQuery.Location = new System.Drawing.Point(1334, 23);
+            this.btnQuery.Location = new System.Drawing.Point(1200, 24);
             this.btnQuery.Name = "btnQuery";
             this.btnQuery.Size = new System.Drawing.Size(119, 44);
             this.btnQuery.TabIndex = 18;
@@ -184,22 +192,36 @@ namespace PTMedicalInsurance.Forms
             this.btnQuery.UseVisualStyleBackColor = true;
             this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click);
             // 
-            // uiLabel3
+            // txtDoctorNo
             // 
-            this.uiLabel3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.uiLabel3.Location = new System.Drawing.Point(1007, 29);
-            this.uiLabel3.Name = "uiLabel3";
-            this.uiLabel3.Size = new System.Drawing.Size(130, 33);
-            this.uiLabel3.TabIndex = 15;
-            this.uiLabel3.Text = "就诊ID:";
-            this.uiLabel3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
-            this.uiLabel3.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
+            this.txtDoctorNo.Cursor = System.Windows.Forms.Cursors.IBeam;
+            this.txtDoctorNo.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.txtDoctorNo.Location = new System.Drawing.Point(748, 28);
+            this.txtDoctorNo.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.txtDoctorNo.MinimumSize = new System.Drawing.Size(1, 16);
+            this.txtDoctorNo.Name = "txtDoctorNo";
+            this.txtDoctorNo.ShowText = false;
+            this.txtDoctorNo.Size = new System.Drawing.Size(147, 33);
+            this.txtDoctorNo.TabIndex = 16;
+            this.txtDoctorNo.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
+            this.txtDoctorNo.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
+            // 
+            // uiLabel4
+            // 
+            this.uiLabel4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.uiLabel4.Location = new System.Drawing.Point(630, 28);
+            this.uiLabel4.Name = "uiLabel4";
+            this.uiLabel4.Size = new System.Drawing.Size(102, 33);
+            this.uiLabel4.TabIndex = 14;
+            this.uiLabel4.Text = "医师编号:";
+            this.uiLabel4.TextAlign = System.Drawing.ContentAlignment.TopRight;
+            this.uiLabel4.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
             // 
             // txtAdmID
             // 
             this.txtAdmID.Cursor = System.Windows.Forms.Cursors.IBeam;
             this.txtAdmID.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtAdmID.Location = new System.Drawing.Point(1159, 29);
+            this.txtAdmID.Location = new System.Drawing.Point(1014, 30);
             this.txtAdmID.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.txtAdmID.MinimumSize = new System.Drawing.Size(1, 16);
             this.txtAdmID.Name = "txtAdmID";
@@ -209,43 +231,86 @@ namespace PTMedicalInsurance.Forms
             this.txtAdmID.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
             this.txtAdmID.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
             // 
-            // uiLabel4
+            // uiLabel3
             // 
-            this.uiLabel4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.uiLabel4.Location = new System.Drawing.Point(694, 30);
-            this.uiLabel4.Name = "uiLabel4";
-            this.uiLabel4.Size = new System.Drawing.Size(131, 33);
-            this.uiLabel4.TabIndex = 14;
-            this.uiLabel4.Text = "医师编号:";
-            this.uiLabel4.TextAlign = System.Drawing.ContentAlignment.TopRight;
-            this.uiLabel4.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
+            this.uiLabel3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.uiLabel3.Location = new System.Drawing.Point(915, 28);
+            this.uiLabel3.Name = "uiLabel3";
+            this.uiLabel3.Size = new System.Drawing.Size(79, 33);
+            this.uiLabel3.TabIndex = 15;
+            this.uiLabel3.Text = "就诊ID:";
+            this.uiLabel3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
+            this.uiLabel3.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
             // 
-            // txtDoctorNo
+            // dgvAdm
             // 
-            this.txtDoctorNo.Cursor = System.Windows.Forms.Cursors.IBeam;
-            this.txtDoctorNo.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.txtDoctorNo.Location = new System.Drawing.Point(841, 29);
-            this.txtDoctorNo.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
-            this.txtDoctorNo.MinimumSize = new System.Drawing.Size(1, 16);
-            this.txtDoctorNo.Name = "txtDoctorNo";
-            this.txtDoctorNo.ShowText = false;
-            this.txtDoctorNo.Size = new System.Drawing.Size(147, 33);
-            this.txtDoctorNo.TabIndex = 16;
-            this.txtDoctorNo.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
-            this.txtDoctorNo.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
+            this.dgvAdm.AllowUserToAddRows = false;
+            dataGridViewCellStyle16.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
+            this.dgvAdm.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle16;
+            this.dgvAdm.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
+            this.dgvAdm.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
+            dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            dataGridViewCellStyle17.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
+            dataGridViewCellStyle17.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle17.ForeColor = System.Drawing.Color.White;
+            dataGridViewCellStyle17.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
+            dataGridViewCellStyle17.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle17.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.dgvAdm.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle17;
+            this.dgvAdm.ColumnHeadersHeight = 32;
+            this.dgvAdm.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
+            dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle18.BackColor = System.Drawing.Color.White;
+            dataGridViewCellStyle18.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle18.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
+            dataGridViewCellStyle18.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255)))));
+            dataGridViewCellStyle18.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
+            dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.dgvAdm.DefaultCellStyle = dataGridViewCellStyle18;
+            this.dgvAdm.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.dgvAdm.EnableHeadersVisualStyles = false;
+            this.dgvAdm.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.dgvAdm.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(104)))), ((int)(((byte)(173)))), ((int)(((byte)(255)))));
+            this.dgvAdm.Location = new System.Drawing.Point(0, 87);
+            this.dgvAdm.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.dgvAdm.Name = "dgvAdm";
+            dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle19.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(249)))), ((int)(((byte)(255)))));
+            dataGridViewCellStyle19.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle19.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
+            dataGridViewCellStyle19.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(160)))), ((int)(((byte)(255)))));
+            dataGridViewCellStyle19.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
+            dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+            this.dgvAdm.RowHeadersDefaultCellStyle = dataGridViewCellStyle19;
+            this.dgvAdm.RowHeadersWidth = 62;
+            dataGridViewCellStyle20.BackColor = System.Drawing.Color.White;
+            dataGridViewCellStyle20.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle20.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
+            dataGridViewCellStyle20.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(236)))), ((int)(((byte)(255)))));
+            dataGridViewCellStyle20.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(48)))), ((int)(((byte)(48)))));
+            this.dgvAdm.RowsDefaultCellStyle = dataGridViewCellStyle20;
+            this.dgvAdm.RowTemplate.Height = 23;
+            this.dgvAdm.SelectedIndex = -1;
+            this.dgvAdm.Size = new System.Drawing.Size(1824, 210);
+            this.dgvAdm.TabIndex = 20;
+            this.dgvAdm.ZoomScaleRect = new System.Drawing.Rectangle(0, 0, 0, 0);
+            this.dgvAdm.SelectIndexChange += new Sunny.UI.UIDataGridView.OnSelectIndexChange(this.dgvAdm_SelectIndexChange);
             // 
             // PrescriptionForm
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1465, 555);
+            this.ClientSize = new System.Drawing.Size(1824, 729);
+            this.Controls.Add(this.dgvAdm);
             this.Controls.Add(this.uiPanel1);
             this.Controls.Add(this.dgvHistory);
+            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Name = "PrescriptionForm";
             this.Text = "历史处方信息";
             this.Load += new System.EventHandler(this.PrescriptionForm_Load);
             ((System.ComponentModel.ISupportInitialize)(this.dgvHistory)).EndInit();
             this.uiPanel1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.dgvAdm)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -263,5 +328,6 @@ namespace PTMedicalInsurance.Forms
         private Sunny.UI.UILabel uiLabel4;
         private Sunny.UI.UITextBox txtAdmID;
         private Sunny.UI.UILabel uiLabel3;
+        private Sunny.UI.UIDataGridView dgvAdm;
     }
 }

+ 60 - 1
Forms/PrescriptionForm.cs

@@ -1,6 +1,7 @@
 using Newtonsoft.Json.Linq;
 using PTMedicalInsurance.Business;
 using PTMedicalInsurance.FormSetter;
+using PTMedicalInsurance.Helper;
 using PTMedicalInsurance.Variables;
 using System;
 using System.Collections.Generic;
@@ -22,6 +23,7 @@ namespace PTMedicalInsurance.Forms
         {
             InitializeComponent();
 
+            grdSetter.SetHeaderTextOfHistoryAdmInfo(dgvAdm);
             grdSetter.SetHeaderTextOfHistoryPrescription(dgvHistory);
 
         }
@@ -30,8 +32,35 @@ namespace PTMedicalInsurance.Forms
         {
             this.txtName.Text = Global.pat.name;
             this.txtNo.Text = Global.pat.certNO;
+
+            this.loadAdmInfo();
+        }
+
+        private void loadAdmInfo()
+        {
+            
+            string sqlStr = "select a.MdtrtID,a.PatientName,a.CertificateNO as PsnCertNO,a.Gender as Gend,b.AttendDoctorNO,a.SettlementDate,b.RegDate,b.ChiefPhyDocName,a.Adm_Dr,a.Age,'' as PsnType, '' as EmpName,'' as AdmInDepName,'' as AdmBed,'' as MainDiagName,'' as OpertName,'' as insuplcAdmdvs,'' as sZTSM  FROM  BS_MedInsuSettlement a inner join BS_MedInsuRegisterInfo b on a.MdtrtID=b.insuRegID WHERE a.Hospital_Dr=" + Global.inf.hospitalDr+" and b.ChiefPhyDocName ='"+Global.user.name+"' and b.RegDate>='"+DateTime.Now.ToString("yyyy-MM-dd")+"'";
+
+            JObject joSqlstr = new JObject();
+            joSqlstr.Add("sqlStr", sqlStr);
+            joSqlstr.Add("Type", "MedInsuHosPInfo");
+            JArray jaParam = new JArray();
+            jaParam.Add(joSqlstr);
+            JObject joSettlQuery = new JObject();
+            joSettlQuery.Add("params", jaParam);
+            joSettlQuery.Add("code", "09010059");
+
+            InvokeHelper invoker = new InvokeHelper();
+            JObject joRtn = invoker.invokeInsuService(joSettlQuery.ToString(), "查询结算信息");
+
+            JArray ja = JArray.Parse(JsonHelper.getDestValue(joRtn, "result.data"));
+            if (ja?.Count > 0) {
+                DataTable dt = ja.ToObject<DataTable>();
+                dgvAdm.DataSource = dt;
+            }
         }
 
+
         public void initList(JArray joData)
         {
             DataTable dtData = (DataTable)joData.ToObject(typeof(DataTable));
@@ -40,7 +69,20 @@ namespace PTMedicalInsurance.Forms
 
         private void btnQuery_Click(object sender, EventArgs e)
         {
-            JArray list = hBus.QueryPatientPrescription(txtName.Text.Trim(), txtNo.Text.Trim(),txtDoctorNo.Text.Trim(),txtAdmID.Text.Trim());
+            if (dgvAdm.SelectedIndex < 0) {
+
+                MessageBox.Show("请先选择就诊信息");
+                return;
+            }
+            DataGridViewCellCollection dgvc = dgvAdm.Rows[dgvAdm.SelectedIndex].Cells;
+            if (dgvc == null || dgvc.Count<1) {
+                return;
+            }
+            JArray list = hBus.QueryPatientPrescription(
+                dgvc["PatientName"].Value.ToString(),
+                dgvc["PsnCertNO"].Value.ToString(),
+                dgvc["AttendDoctorNO"].Value.ToString(),
+                dgvc["MdtrtID"].Value.ToString());
             if (list?.Count > 0)
             {
                 initList(list);
@@ -49,6 +91,23 @@ namespace PTMedicalInsurance.Forms
                 MessageBox.Show("没有查询到任何记录!");
             }
         }
+
+        private void dgvAdm_SelectIndexChange(object sender, int index)
+        {
+            if (index < 0)
+            {
+                return;
+            }
+            if (dgvAdm.SelectedRows?.Count < 1)
+            {
+                return;
+            }
+            DataGridViewCellCollection dgvc = dgvAdm.SelectedRows[0].Cells;
+            txtName.Text = dgvc["PatientName"].Value.ToString();
+            txtNo.Text = dgvc["PsnCertNO"].Value.ToString();
+            txtDoctorNo.Text = dgvc["AttendDoctorNO"].Value.ToString();
+            txtAdmID.Text = dgvc["MdtrtID"].Value.ToString();
+        }
     }
 
 

+ 5 - 1
Helper/InvokeHelper.cs

@@ -184,7 +184,12 @@ namespace PTMedicalInsurance.Helper
         /// <returns></returns>
         public JObject invokeCenterAgentService(string funNo,JObject joInput)
         {
+            Global.curEvt.URL = Global.inf.centerURL;
             string data = JsonHelper.setCenterInpar(funNo, joInput);
+            if (funNo.StartsWith("35")) { 
+                // 进销存测试
+                Global.curEvt.URL = "http://10.42.149.235:9091/hss/api/hiinterface";
+            }
             return invokeCenterService(data);
         }
         private JObject invokeCenterService(string data, ModeEnum mode = ModeEnum.REST)
@@ -306,7 +311,6 @@ namespace PTMedicalInsurance.Helper
         /// <param name="input"></param>
         /// <returns></returns>
         public JObject invokeCenterService(string data) {
-            Global.curEvt.URL = Global.inf.centerURL;
             return invokeCenterService(data,ModeEnum.REST);
         }
         /// <summary>

+ 6 - 2
Helper/InvokeRestCenter.cs

@@ -67,9 +67,13 @@ namespace PTMedicalInsurance.Helper
                     //获得响应流
                     response = (HttpWebResponse)request.GetResponse();
                 }
-                catch (Exception ex)
+                catch (WebException ex)
                 {
-                    JsonHelper.setExceptionJson(-99, "centerServeiceInvok中获得响应流异常", ex.Message);
+                    HttpWebResponse res = (HttpWebResponse)ex.Response;
+                    Stream myResponseStream = res.GetResponseStream();
+                    StreamReader myStreamReader = new StreamReader(myResponseStream, Encoding.UTF8);
+                    string retString = myStreamReader.ReadToEnd();
+                    outputData = JsonHelper.setExceptionJson(-99, "centerServeiceInvok中获得响应流异常", retString).ToString();
                     return -1;
                 }
                 outputData = getResponseData(response);