OutpatientRegistration.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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 MedicalInsurance.Common;
  13. using MedicalInsurance.Helper;
  14. namespace ChengDuMedInsu2
  15. {
  16. public partial class OutpatientRegistration : Form
  17. {
  18. public OutpatientRegistration()
  19. {
  20. InitializeComponent();
  21. /*
  22. string sqlCondition = " and Interface_ID = '" + GlobalVariables.InterfaceID + "'";
  23. string sqlStr = "select sNO AS Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type = 'insutype'" + sqlCondition;
  24. //SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr);
  25. string sqlStr2 = "select Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type='insutype' and Interface_Dr = '7'and Hosp_Dr ='63'";
  26. SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr2);
  27. sqlStr = "select Code,SectionName AS Name FROM CloudMedicalInsurancePlatform_Tables.Diagnose where Type='Diagnose'" + sqlCondition;
  28. SetDBLKCombox(ref dblkcbxDisease, sqlStr2);
  29. sqlStr = "select sNO AS Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type = 'psn_setlway'" + sqlCondition;
  30. SetDBLKCombox(ref dblkcbxSettelmentWay, sqlStr);
  31. sqlStr = "select sNO AS Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type = 'MED_TYPE'" + sqlCondition;
  32. SetDBLKCombox(ref dblkcbxMedicalType, sqlStr);
  33. sqlStr = "select Code,Name FROM CloudMedicalInsurancePlatform_Tables.Diagnose where Type='Operation'" + sqlCondition;
  34. SetDBLKCombox(ref dblkcbxOperation, sqlStr);
  35. */
  36. string sqlCondition = " and Interface_Dr = '" + GlobalVariables.interfaceDr.ToString() + "'";
  37. sqlCondition = sqlCondition + "and Hosp_Dr ='" + GlobalVariables.hospitalDr.ToString() + "'";
  38. string sqlStr = "select Code,Name FROM MedInsu_Tables.Dictionary where Type = 'insutype'" + sqlCondition;
  39. SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr);
  40. //sqlStr = "select Code, Name FROM CloudMedicalInsurancePlatform_Tables.Directory where HisType=4" + sqlCondition;
  41. //SetDBLKCombox(ref dblkcbxDisease, sqlStr);
  42. sqlStr = "select Code,Name FROM MedInsu_Tables.Dictionary where Type = 'psn_setlway'" + sqlCondition;
  43. SetDBLKCombox(ref dblkcbxSettelmentWay, sqlStr);
  44. sqlStr = "select Code,Name FROM MedInsu_Tables.Dictionary where Type = 'MED_TYPE'" + sqlCondition;
  45. SetDBLKCombox(ref dblkcbxMedicalType, sqlStr);
  46. sqlStr = "select Code,Name FROM MedInsu_Tables.Dictionary where Type = 'mdtrt_grp_type'" + sqlCondition;
  47. SetDBLKCombox(ref dblkcbxMdtrtGrpType, sqlStr);
  48. sqlStr = "select Code,Name FROM MedInsu_Tables.Dictionary where Type = 'opt_er_refl_flag'" + sqlCondition;
  49. SetDBLKCombox(ref dblkcbxOptErReflFlag, sqlStr);
  50. //sqlStr = "select Code,Name FROM CloudMedicalInsurancePlatform_Tables.Directory where HisType=5" + sqlCondition;
  51. //SetDBLKCombox(ref dblkcbxOperation, sqlStr);
  52. //dgvDiagnose.DataSource = DtDiagnose;
  53. ////DtDiagnose.AcceptChanges();
  54. //dgvDiagnose.ReadOnly = true;
  55. //MessageBox.Show(DtDiagnose.Rows.Count.ToString());
  56. //MessageBox.Show(DtDiagnose.Rows[0]["diag_name"].ToString());
  57. //DataGridViewColumn column = new PTControl.DataGridViewDBLKBColumn();
  58. //(column as PTControl.DataGridViewDBLKBColumn).SDisplayField = "Code,Name,SearchCode";
  59. //(column as PTControl.DataGridViewDBLKBColumn).SDisplayMember = "Name";
  60. //(column as PTControl.DataGridViewDBLKBColumn).SKeyWords = "SearchCode";
  61. //column.DataGridView.Width = 400;
  62. //column.DataGridView.Columns[0].Name = "编码";
  63. //column.DataGridView.Columns[1].Name = "名称";
  64. //column.DataGridView.Columns[2].Name = "查找码";
  65. //column.DataGridView.Columns[0].Width = 100;
  66. //column.DataGridView.Columns[1].Width = 200;
  67. //sqlStr = "select sNO AS Code,Name FROM CloudMedicalInsurancePlatform_Tables.Dictionary where Type = 'psn_setlway'" + sqlCondition;
  68. //(column as PTControl.DataGridViewDBLKBColumn).DataSource = GetDBLKComboxTable(sqlStr);
  69. //dgvDiagnose.Columns.Add(column);
  70. //dgvDiagnose.Columns[10].Name = "测试";
  71. //dgvDiagnose.Columns[10].DisplayIndex = 0;
  72. //string diseaseTypeParam = string.Empty;
  73. //string diseaseTypeRtn = iris.Invoke(diseaseTypeParam);
  74. //dynamic diseaseTypeRtnRtnJson = JsonConvert.DeserializeObject(diseaseTypeRtn);
  75. //dtDiseaseType = (DataTable)diseaseTypeRtnRtnJson.ToObject(typeof(DataTable));
  76. //string insuranceTypeParam = string.Empty;
  77. //string insuranceTypeRtn = iris.Invoke(insuranceTypeParam);
  78. //dynamic insuranceTypeRtnRtnJson = JsonConvert.DeserializeObject(insuranceTypeRtn);
  79. //dtInsuranceType = (DataTable)insuranceTypeRtnRtnJson.ToObject(typeof(DataTable));
  80. cbxAccountPay.Checked = true;
  81. personAccountUsedFlag = "1";
  82. }
  83. private DataTable dtDisease;
  84. private DataTable dtDiseaseType;
  85. private DataTable dtInsuranceType;
  86. private DataTable dtMedicalType;
  87. private DataTable dtOperation;
  88. private DataTable dtSettelmentType;
  89. //险种
  90. public string insuType { get; set; }
  91. public string insuTypeName { get; set; }
  92. //医疗类别
  93. public string med_type { get; set; }
  94. public string med_type_name { get; set; }
  95. //诊断
  96. public string diseCodg { get; set; }
  97. public string diseName{ get; set; }
  98. //手术
  99. public string oprn_oprt_code { get; set; }
  100. public string oprn_oprt_name{ get; set; }
  101. //病种
  102. public string dise_type_code { get; set; }
  103. public string dise_type_name { get; set; }
  104. //结算方式
  105. public string psn_setlway { get; set; }
  106. public string psn_setlway_name { get; set; }
  107. public DataTable DtDiagnose { get; set; }
  108. public string personAccountUsedFlag = "0";
  109. public string mdtrt_grp_type { get; set; }
  110. public string opt_er_refl_flag { get; set; }
  111. private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
  112. {
  113. }
  114. private DataTable GetDBLKComboxTable(string sqlStr)
  115. {
  116. InvokeHelper invoker = new InvokeHelper();
  117. dynamic joInparm = new JObject();
  118. dynamic joTmp = new JObject();
  119. joTmp.sqlStr = sqlStr;
  120. JArray jaParams = new JArray();
  121. jaParams.Add(joTmp);
  122. joInparm.Add("params", JArray.FromObject(jaParams));
  123. joInparm.code = "09010014";
  124. string inParam = joInparm.ToString();
  125. JObject joRtn = invoker.invokeInsuService(inParam,"获取下拉框消息");
  126. //dynamic jsonRtn = JsonConvert.DeserializeObject(strRtn);
  127. DataTable dt = (DataTable)joRtn["result"].ToObject(typeof(DataTable));
  128. //dt.Columns[0].ColumnName = "编码";
  129. //dt.Columns[1].ColumnName = "名称";
  130. //dt.Columns[2].ColumnName = "拼音查找码";
  131. return dt;
  132. }
  133. private void SetDBLKCombox(ref PTControl.DBLookupCombox dblcbx, string sqlStr)
  134. {
  135. dblcbx.sDisplayField = "Code,Name,SearchCode";
  136. dblcbx.sDisplayMember = "名称";
  137. dblcbx.sKeyWords = "SearchCode";
  138. dblcbx.DataSource = GetDBLKComboxTable(sqlStr);
  139. dblcbx.RowFilterVisible = true;
  140. dblcbx.TextBox.Width = 400;
  141. dblcbx.DataGridView.Width = 400;
  142. dblcbx.DataGridView.Columns[0].Name = "编码";
  143. dblcbx.DataGridView.Columns[1].Name = "名称";
  144. dblcbx.DataGridView.Columns[2].Name = "查找码";
  145. dblcbx.DataGridView.Columns[0].Width = 100;
  146. dblcbx.DataGridView.Columns[1].Width = 200;
  147. }
  148. private void OutpatientRegistration_Load(object sender, EventArgs e)
  149. {
  150. dgvDiagnose.DataSource = DtDiagnose;
  151. //DtDiagnose.AcceptChanges();
  152. dgvDiagnose.ReadOnly = true;
  153. }
  154. private void button1_Click_1(object sender, EventArgs e)
  155. {
  156. this.DialogResult = DialogResult.OK;
  157. }
  158. private void dblkcbxInsuranceType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  159. {
  160. DataGridViewRow row = e.Value as DataGridViewRow;
  161. DataRowView dataRow = row.DataBoundItem as DataRowView;
  162. insuType = dataRow["Code"].ToString().Trim();
  163. insuTypeName = dataRow["Name"].ToString().Trim();
  164. }
  165. private void dblkcbxMedicalType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  166. {
  167. DataGridViewRow row = e.Value as DataGridViewRow;
  168. DataRowView dataRow = row.DataBoundItem as DataRowView;
  169. med_type = dataRow["Code"].ToString().Trim();
  170. med_type_name = dataRow["Name"].ToString().Trim();
  171. }
  172. private void dblkcbxDisease_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  173. {
  174. DataGridViewRow row = e.Value as DataGridViewRow;
  175. DataRowView dataRow = row.DataBoundItem as DataRowView;
  176. diseCodg = dataRow["Code"].ToString().Trim();
  177. diseName = dataRow["Name"].ToString().Trim();
  178. }
  179. private void dblkcbxOperation_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  180. {
  181. DataGridViewRow row = e.Value as DataGridViewRow;
  182. DataRowView dataRow = row.DataBoundItem as DataRowView;
  183. oprn_oprt_code = dataRow["Code"].ToString().Trim();
  184. oprn_oprt_name = dataRow["Name"].ToString().Trim();
  185. }
  186. private void dblkcbxSettelmentWay_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  187. {
  188. DataGridViewRow row = e.Value as DataGridViewRow;
  189. DataRowView dataRow = row.DataBoundItem as DataRowView;
  190. psn_setlway = dataRow["Code"].ToString().Trim();
  191. psn_setlway_name = dataRow["Name"].ToString().Trim();
  192. }
  193. private void dblkcbxDiseaseType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  194. {
  195. DataGridViewRow row = e.Value as DataGridViewRow;
  196. DataRowView dataRow = row.DataBoundItem as DataRowView;
  197. dise_type_code = dataRow["Code"].ToString().Trim();
  198. dise_type_name = dataRow["Name"].ToString().Trim();
  199. }
  200. private void button2_Click(object sender, EventArgs e)
  201. {
  202. this.DialogResult = DialogResult.Cancel;
  203. }
  204. private void cbxAccountPay_ValueChanged(object sender, bool value)
  205. {
  206. if (cbxAccountPay.Checked)
  207. {
  208. personAccountUsedFlag = "1";
  209. }
  210. else
  211. {
  212. personAccountUsedFlag = "0";
  213. }
  214. }
  215. private void dblkcbxMdtrtGrpType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  216. {
  217. DataGridViewRow row = e.Value as DataGridViewRow;
  218. DataRowView dataRow = row.DataBoundItem as DataRowView;
  219. mdtrt_grp_type = dataRow["Code"].ToString().Trim();
  220. }
  221. private void dblkcbxOptErReflFlag_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  222. {
  223. DataGridViewRow row = e.Value as DataGridViewRow;
  224. DataRowView dataRow = row.DataBoundItem as DataRowView;
  225. opt_er_refl_flag = dataRow["Code"].ToString().Trim();
  226. }
  227. }
  228. }