OutpatientRegistration.cs 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. using Newtonsoft.Json;
  2. using Newtonsoft.Json.Linq;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. using PTMedicalInsurance.Common;
  13. using PTMedicalInsurance.Helper;
  14. using PTMedicalInsurance.Variables;
  15. namespace PTMedicalInsurance.Forms
  16. {
  17. public partial class OutpatientRegistration : Form
  18. {
  19. public OutpatientRegistration()
  20. {
  21. InitializeComponent();
  22. this.StartPosition = FormStartPosition.CenterParent;
  23. /*
  24. string sqlCondition = " and Interface_ID = '" + Global.inf.InterfaceID + "'";
  25. string sqlStr = "select sNO AS Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type = 'insutype'" + sqlCondition;
  26. //SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr);
  27. string sqlStr2 = "select Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type='insutype' and Interface_Dr = '7'and Hosp_Dr ='63'";
  28. SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr2);
  29. sqlStr = "select Code,SectionName AS Name FROM CloudMedicalInsurancePlatform_Tables.Diagnose where Type='Diagnose'" + sqlCondition;
  30. SetDBLKCombox(ref dblkcbxDisease, sqlStr2);
  31. sqlStr = "select sNO AS Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type = 'psn_setlway'" + sqlCondition;
  32. SetDBLKCombox(ref dblkcbxSettelmentWay, sqlStr);
  33. sqlStr = "select sNO AS Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type = 'MED_TYPE'" + sqlCondition;
  34. SetDBLKCombox(ref dblkcbxMedicalType, sqlStr);
  35. sqlStr = "select Code,Name FROM CloudMedicalInsurancePlatform_Tables.Diagnose where Type='Operation'" + sqlCondition;
  36. SetDBLKCombox(ref dblkcbxOperation, sqlStr);
  37. */
  38. string sqlCondition = " and A.Interface_Dr = '" + Global.inf.interfaceDr.ToString() + "'";
  39. if (Global.pat.RYorCY == "2")
  40. {
  41. string sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr "
  42. + " WHERE B.Code='" + Global.pat.insuType + "' and A.InsuCode = 'BAE059'" + sqlCondition;
  43. SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr);
  44. sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr"
  45. + " WHERE B.Code='" + Global.pat.medType + "' and A.InsuCode = 'AKA130'" + sqlCondition;
  46. SetDBLKCombox(ref dblkcbxMedicalType, sqlStr);
  47. }
  48. else
  49. {
  50. string sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr "
  51. + " WHERE A.InsuCode = 'BAE059'" + sqlCondition;
  52. SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr);
  53. sqlStr = " SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr "
  54. + " WHERE A.InsuCode = 'AKA130'" + sqlCondition;
  55. SetDBLKCombox(ref dblkcbxMedicalType, sqlStr);
  56. }
  57. cbxAccountPay.Checked = true;
  58. personAccountUsedFlag = "1";
  59. }
  60. public Boolean b2001 = false;
  61. private DataTable dtDisease;
  62. private DataTable dtDiseaseType;
  63. private DataTable dtInsuranceType;
  64. private DataTable dtMedicalType;
  65. private DataTable dtOperation;
  66. private DataTable dtSettelmentType;
  67. //险种
  68. public string insuType { get; set; }
  69. public string insuTypeName { get; set; }
  70. //医疗类别
  71. public string med_type { get; set; }
  72. public string med_type_name { get; set; }
  73. //诊断
  74. public string diseCodg { get; set; }
  75. public string diseName{ get; set; }
  76. //手术
  77. public string oprn_oprt_code { get; set; }
  78. public string oprn_oprt_name{ get; set; }
  79. //病种
  80. public string dise_type_code { get; set; }
  81. public string dise_type_name { get; set; }
  82. //结算方式
  83. public string psn_setlway { get; set; }
  84. public string psn_setlway_name { get; set; }
  85. public DataTable DtDiagnose { get; set; }
  86. public string personAccountUsedFlag = "0";
  87. //public string sYBDJLSH;
  88. private DataTable GetDBLKComboxTable(string sqlStr)
  89. {
  90. InvokeHelper invoker = new InvokeHelper();
  91. dynamic joInparm = new JObject();
  92. dynamic joTmp = new JObject();
  93. joTmp.sqlStr = sqlStr;
  94. JArray jaParams = new JArray();
  95. jaParams.Add(joTmp);
  96. joInparm.Add("params", JArray.FromObject(jaParams));
  97. joInparm.code = "09010014";
  98. string inParam = joInparm.ToString();
  99. JObject joRtn = invoker.invokeInsuService(inParam,"获取下拉框消息");
  100. //dynamic jsonRtn = JsonConvert.DeserializeObject(strRtn);
  101. DataTable dt = (DataTable)joRtn["result"].ToObject(typeof(DataTable));
  102. //dt.Columns[0].ColumnName = "编码";
  103. //dt.Columns[1].ColumnName = "名称";
  104. //dt.Columns[2].ColumnName = "拼音查找码";
  105. return dt;
  106. }
  107. private void SetDBLKCombox(ref PTControl.DBLookupCombox dblcbx, string sqlStr)
  108. {
  109. dblcbx.sDisplayField = "Code,Name,SearchCode";
  110. dblcbx.sDisplayMember = "名称";
  111. dblcbx.sKeyWords = "Code,SearchCode";
  112. dblcbx.DataSource = GetDBLKComboxTable(sqlStr);
  113. dblcbx.RowFilterVisible = true;
  114. dblcbx.TextBox.Width = 400;
  115. dblcbx.DataGridView.Width = 400;
  116. dblcbx.DataGridView.Columns[0].Name = "编码";
  117. dblcbx.DataGridView.Columns[1].Name = "名称";
  118. dblcbx.DataGridView.Columns[2].Name = "查找码";
  119. dblcbx.DataGridView.Columns[0].Width = 100;
  120. dblcbx.DataGridView.Columns[1].Width = 200;
  121. }
  122. private void OutpatientRegistration_Load(object sender, EventArgs e)
  123. {
  124. dgvDiagnose.AutoGenerateColumns = false;
  125. dgvDiagnose.DataSource = DtDiagnose;
  126. //DtDiagnose.AcceptChanges();
  127. dgvDiagnose.ReadOnly = true;
  128. }
  129. private void dblkcbxInsuranceType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  130. {
  131. DataGridViewRow row = e.Value as DataGridViewRow;
  132. DataRowView dataRow = row.DataBoundItem as DataRowView;
  133. insuType = dataRow["Code"].ToString().Trim();
  134. insuTypeName = dataRow["Name"].ToString().Trim();
  135. Global.pat.insuType = insuType;
  136. }
  137. private void dblkcbxMedicalType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  138. {
  139. DataGridViewRow row = e.Value as DataGridViewRow;
  140. DataRowView dataRow = row.DataBoundItem as DataRowView;
  141. med_type = dataRow["Code"].ToString().Trim();
  142. med_type_name = dataRow["Name"].ToString().Trim();
  143. Global.pat.medType = med_type;
  144. Global.pat.medTypeName = med_type_name;
  145. }
  146. private void cbxAccountPay_ValueChanged(object sender, bool value)
  147. {
  148. if (cbxAccountPay.Checked)
  149. {
  150. personAccountUsedFlag = "1";
  151. }
  152. else
  153. {
  154. personAccountUsedFlag = "0";
  155. }
  156. }
  157. private void btnOK_Click(object sender, EventArgs e)
  158. {
  159. //Global.pat.mdtrtID = sYBDJLSH;
  160. if (cbxAccountPay.Checked)
  161. Global.pat.personAccountUsedFlag = 1;
  162. else
  163. Global.pat.personAccountUsedFlag = 0;
  164. if (chk_SJDSFBZ.Checked)
  165. Global.pat.relttpflag = 1;
  166. else
  167. Global.pat.relttpflag = 0;
  168. if (chk_WSBZ.Checked)
  169. Global.pat.trumflag = 1;
  170. else
  171. Global.pat.trumflag = 0;
  172. if (cbb_JZRQLX.SelectedIndex >= 0)
  173. Global.pat.mdtrtgrptype = cbb_JZRQLX.Text.Trim().Substring(0, 1);
  174. this.DialogResult = DialogResult.OK;
  175. }
  176. private void btnCancel_Click(object sender, EventArgs e)
  177. {
  178. this.DialogResult = DialogResult.Cancel;
  179. }
  180. }
  181. }