AssistSelect.cs 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. using Newtonsoft.Json.Linq;
  2. using PTMedicalInsurance.Business;
  3. using PTMedicalInsurance.Helper;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.ComponentModel;
  7. using System.Data;
  8. using System.Drawing;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using System.Windows.Forms;
  13. using PTMedicalInsurance.Variables;
  14. using PTMedicalInsurance.FormSetter;
  15. using Sunny.UI;
  16. namespace CCunMI.Forms
  17. {
  18. public partial class AssistSelect : Form
  19. {
  20. public AssistSelect()
  21. {
  22. InitializeComponent();
  23. }
  24. HisMainBusiness hBus = new HisMainBusiness();
  25. private InvokeHelper invoker = new InvokeHelper();
  26. InsuServices rIS= new InsuServices();
  27. GridViewSetter grdSetter = new GridViewSetter();
  28. private void AssistSelect_Load(object sender, EventArgs e)
  29. {
  30. uiDatetimePicker1.Text = DateTime.Now.ToString("yyyy-MM-01 00:00:00");
  31. uiDatetimePicker2.Value = DateTime.Now.AddDays(1 - DateTime.Now.Day).AddMonths(1).AddDays(-1);
  32. //ComboxSetter cbxSetter = new ComboxSetter();
  33. //cbxSetter.setCbxDictionaryDataSource(Global.inf.interfaceDr.ToString(), "insutype", uiComboBox3);
  34. uiDatetimePicker3.Text = DateTime.Now.ToString("yyyy-MM-01 00:00:00");
  35. uiDatetimePicker4.Text = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd 23:59:59");
  36. }
  37. private void uiButton1_Click(object sender, EventArgs e)
  38. {
  39. string outParam;
  40. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  41. if (hBus.readCard(out outParam) != 0)
  42. {
  43. MessageBox.Show(JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString());
  44. }
  45. else
  46. {
  47. //展示患者信息界面
  48. if (hBus.showPatInfo(outParam, out outParam) != 0)
  49. {
  50. MessageBox.Show(JsonHelper.setIrisReturnValue(0, "展示患者信息失败", JObject.Parse(outParam)).ToString());
  51. }
  52. else
  53. {
  54. }
  55. }
  56. uiTextBox1.Text = Global.pat.psn_no;
  57. }
  58. private void uiMbyyButton1_Click(object sender, EventArgs e)
  59. {
  60. grdSetter.SetMbMedicationHistory(uiDataGridView1);
  61. JObject jo5205 = new JObject();
  62. jo5205.Add("psn_no", uiTextBox1.Text);//必填
  63. jo5205.Add("begntime", uiDatetimePicker1.Text);//yyyy-MM-dd HH:mm:ss必填
  64. jo5205.Add("endtime", uiDatetimePicker2.Text);//yyyy-MM-dd HH:mm:ss
  65. JObject data5205 = new JObject();
  66. data5205.Add("data", jo5205);
  67. JObject out5205 = invoker.invokeCenterService("5205", JObject.Parse(JsonHelper.setCenterInpar("5205", data5205)));
  68. DataTable dt = (DataTable)out5205["output"]["feedetail"].ToObject(typeof(DataTable));
  69. uiDataGridView1.DataSource = dt;
  70. }
  71. private void uiPanel1_Click(object sender, EventArgs e)
  72. {
  73. }
  74. private void uiButton2_Click(object sender, EventArgs e)
  75. {
  76. string Yllb = "";
  77. if (uiComboBox3.SelectedIndex == 0)
  78. {
  79. Yllb = "11";
  80. }else if (uiComboBox3.SelectedIndex == 1)
  81. {
  82. Yllb = "21";
  83. }
  84. else if (uiComboBox3.SelectedIndex == 2)
  85. {
  86. Yllb = "26";
  87. }
  88. //人员待遇享受检查
  89. string errMsg = "";
  90. JObject joData2001 = new JObject();
  91. joData2001.Add("psn_no", uiTextBox2.Text);
  92. joData2001.Add("insutype", uiTextBox4.Text);
  93. joData2001.Add("fixmedins_code", Global.inf.hospitalNO);
  94. joData2001.Add("med_type", Yllb);
  95. joData2001.Add("begntime", uiDatetimePicker3.Text);
  96. joData2001.Add("endtime", uiDatetimePicker4.Text);
  97. joData2001.Add("dise_codg", "");
  98. joData2001.Add("dise_name", "");
  99. joData2001.Add("oprn_oprt_code", "");
  100. joData2001.Add("oprn_oprt_name", "");
  101. joData2001.Add("matn_type", "");
  102. joData2001.Add("birctrl_type", "");
  103. JObject joInput = new JObject();
  104. joInput.Add("data", joData2001);
  105. InvokeHelper invoker = new InvokeHelper();
  106. JObject joRtn2001 = invoker.invokeCenterService("2001", JsonHelper.setCenterInpar("2001", joInput));
  107. JObject OutIDInfo=new JObject();
  108. JArray joDic;
  109. if (JsonHelper.parseCenterRtnValue(joRtn2001, out errMsg) != 0)
  110. {
  111. MessageBox.Show("人员待遇享受检查调用失败,中心返回错误信息:" + errMsg);
  112. }
  113. else
  114. {
  115. JArray joTrtinfo = JArray.Parse(JsonHelper.getDestValue(joRtn2001, "output.trtinfo"));
  116. // MessageBox.Show("获取到返回值数组" + joTrtinfo.ToString());
  117. // MessageBox.Show("数组数量" + joTrtinfo.Count);
  118. if (joTrtinfo.Count > 0)
  119. {
  120. for(int i=0; i<joTrtinfo.Count; i++)
  121. {
  122. OutIDInfo = rIS.getSpecDictionaryValue(Global.inf.interfaceDr.ToString(), "fund_pay_type", joRtn2001["output"]["trtinfo"][i]["fund_pay_type"].ToString());
  123. joDic = JArray.Parse(JsonHelper.getDestValue(OutIDInfo, "result.data"));
  124. if (joDic.Count > 1)
  125. {
  126. joRtn2001["output"]["trtinfo"][i]["fund_pay_type"] = joDic[1]["name"].ToString();
  127. }
  128. }
  129. }
  130. //MessageBox.Show("转换后数据" + joRtn2001["output"]["trtinfo"].ToString());
  131. DataTable dt = (DataTable)joRtn2001["output"]["trtinfo"].ToObject(typeof(DataTable));
  132. grdSetter.SetTreatmentEnjoyVerify(DGrV2001);
  133. DGrV2001.DataSource= dt;
  134. }
  135. }
  136. private void uiButton3_Click(object sender, EventArgs e)
  137. {
  138. string outParam;
  139. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  140. if (hBus.readCard(out outParam) != 0)
  141. {
  142. MessageBox.Show(JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString());
  143. }
  144. else
  145. {
  146. //展示患者信息界面
  147. if (hBus.showPatInfo(outParam, out outParam) != 0)
  148. {
  149. MessageBox.Show(JsonHelper.setIrisReturnValue(0, "展示患者信息失败", JObject.Parse(outParam)).ToString());
  150. }
  151. else
  152. {
  153. JObject joPatInfo = JObject.Parse(outParam);
  154. Global.pat.insuType = JsonHelper.getDestValue(joPatInfo, "selectedInsuInfo.insutype");
  155. Global.pat.psn_no = JsonHelper.getDestValue(joPatInfo, "output.baseinfo.psn_no");
  156. uiTextBox2.Text = Global.pat.psn_no;
  157. uiTextBox4.Text = Global.pat.insuType;
  158. }
  159. }
  160. }
  161. private DataTable GetDBLKComboxTable(string sqlStr)
  162. {
  163. InvokeHelper invoker = new InvokeHelper();
  164. dynamic joInparm = new JObject();
  165. dynamic joTmp = new JObject();
  166. joTmp.sqlStr = sqlStr;
  167. JArray jaParams = new JArray();
  168. jaParams.Add(joTmp);
  169. joInparm.Add("params", JArray.FromObject(jaParams));
  170. joInparm.code = "09010014";
  171. string inParam = joInparm.ToString();
  172. JObject joRtn = invoker.invokeInsuService(inParam, "获取下拉框消息");
  173. //dynamic jsonRtn = JsonConvert.DeserializeObject(strRtn);
  174. DataTable dt = (DataTable)joRtn["result"].ToObject(typeof(DataTable));
  175. //dt.Columns[0].ColumnName = "编码";
  176. //dt.Columns[1].ColumnName = "名称";
  177. //dt.Columns[2].ColumnName = "拼音查找码";
  178. return dt;
  179. }
  180. }
  181. }