OutpatientRegistration.cs 13 KB

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