SpecialPsn.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. using Newtonsoft.Json.Linq;
  2. using PTMedicalInsurance.Helper;
  3. using Sunny.UI;
  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 static System.Windows.Forms.VisualStyles.VisualStyleElement;
  15. using PTMedicalInsurance.Business;
  16. using FastReport.Utils;
  17. using PTMedicalInsurance.FormSetter;
  18. using FastReport.DevComponents.Editors;
  19. namespace HuBeiMI.Forms
  20. {
  21. public partial class SpecialPsn : Form
  22. {
  23. HisMainBusiness hBus = new HisMainBusiness();
  24. private InvokeHelper invoker = new InvokeHelper();
  25. InsuServices rIS = new InsuServices();
  26. GridViewSetter grdSetter = new GridViewSetter();
  27. public SpecialPsn()
  28. {
  29. InitializeComponent();
  30. }
  31. private void SpecialPsn_Load(object sender, EventArgs e)
  32. {
  33. uiTextBox7.Text = Global.inf.hospitalNO;
  34. uiTextBox8.Text = Global.inf.hospitalName;
  35. }
  36. private void uiLabel12_Click(object sender, EventArgs e)
  37. {
  38. }
  39. private void uiButton1_Click(object sender, EventArgs e)
  40. {
  41. dynamic jyjo = new JObject();
  42. jyjo.page_num = "1";//分页默认1 必填
  43. jyjo.page_size = "200";//页大小默认200 必填
  44. jyjo.ipt_psn_sp_flag_detl_id = uiTextBox1.Text;//住院人员特殊标识明细id 字符型 40
  45. jyjo.mdtrt_id = uiTextBox2.Text;//就诊ID 字符型 30
  46. jyjo.psn_no = uiTextBox3.Text;//人员编号 字符型 30
  47. jyjo.psn_cert_type = uiTextBox4.Text;//人员证件类型 字符型 6
  48. jyjo.certno = uiTextBox5.Text;//证件号码 字符型 50
  49. jyjo.psn_name = uiTextBox6.Text;//人员姓名 字符型 50
  50. jyjo.fixmedins_code = uiTextBox7.Text;//定点医药机构编号 字符型 30
  51. jyjo.fixmedins_name = uiTextBox8.Text;//定点医药机构名称 字符型 200
  52. jyjo.ipt_otp_no = uiTextBox9.Text;//住院/ 门诊号 字符型 30
  53. jyjo.ipt_psn_sp_flag_type = uiTextBox10.Text;//住院人员特殊标识类型 字符型 6
  54. jyjo.ipt_psn_sp_flag = uiTextBox11.Text;//住院人员特殊标识 字符型 6
  55. jyjo.admdvs = uiTextBox12.Text;//医保区划 字符型 6
  56. JObject data1= new JObject();
  57. data1.Add("data",jyjo);
  58. InvokeHelper invoker = new InvokeHelper();
  59. JObject joRtn = invoker.invokeCenterService("2407", JsonHelper.setCenterInpar("2407", data1.ToString()));
  60. if (JsonHelper.parseCenterRtnValue(joRtn, out string errMsg) != 0)
  61. {
  62. MessageBox.Show("查询出错:" + joRtn["err_msg"].ToString());
  63. }
  64. }
  65. private void uiPanel1_Click(object sender, EventArgs e)
  66. {
  67. }
  68. private void uiButton2_Click(object sender, EventArgs e)
  69. {
  70. HisMainBusiness hBus = new HisMainBusiness();
  71. string outParam = "";
  72. string errMsg = "";
  73. Global.pat.admType = 1;
  74. string patInfo = "";
  75. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  76. if (hBus.readCard(out outParam) != 0)
  77. {
  78. MessageBox.Show("读卡失败!" + outParam.ToString());
  79. }
  80. else
  81. {
  82. patInfo = outParam;
  83. //展示患者信息界面
  84. if (hBus.showPatInfo(patInfo, out outParam) != 0)
  85. {
  86. }
  87. }
  88. //患者信息赋值给全局变量
  89. patInfo = outParam;
  90. if (hBus.setGlobalPatAfaterShowPatInfo(patInfo, out errMsg) != 0)
  91. {
  92. MessageBox.Show("赋值患者参保信息失败:"+ errMsg.ToString());
  93. }
  94. uiTextBox3.Text = Global.pat.psn_no;
  95. uiTextBox4.Text = "01";
  96. uiTextBox5.Text = Global.pat.certNO;
  97. uiTextBox6.Text = Global.pat.name;
  98. uiTextBox12.Text = Global.pat.insuplc_admdvs;
  99. }
  100. private void uiButton4_Click(object sender, EventArgs e)
  101. {
  102. HisMainBusiness hBus = new HisMainBusiness();
  103. string outParam = "";
  104. string errMsg = "";
  105. Global.pat.admType = 1;
  106. string patInfo = "";
  107. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  108. if (hBus.readCard(out outParam) != 0)
  109. {
  110. MessageBox.Show("读卡失败!" + outParam.ToString());
  111. }
  112. else
  113. {
  114. patInfo = outParam;
  115. //展示患者信息界面
  116. if (hBus.showPatInfo(patInfo, out outParam) != 0)
  117. {
  118. }
  119. }
  120. //患者信息赋值给全局变量
  121. patInfo = outParam;
  122. if (hBus.setGlobalPatAfaterShowPatInfo(patInfo, out errMsg) != 0)
  123. {
  124. MessageBox.Show("赋值患者参保信息失败:" + errMsg.ToString());
  125. }
  126. uiTextBox14.Text = Global.pat.psn_no;
  127. uiTextBox15.Text = "01";
  128. uiTextBox16.Text = Global.pat.certNO;
  129. uiTextBox17.Text = Global.pat.name;
  130. uiTextBox21.Text = Global.pat.insuplc_admdvs;
  131. }
  132. private void uiButton3_Click(object sender, EventArgs e)
  133. {
  134. dynamic jysc = new JObject();
  135. jysc.mdtrt_id = uiTextBox13.Text;//就诊ID 字符型 30
  136. jysc.psn_no = uiTextBox14.Text;//人员编号 字符型 30
  137. jysc.psn_cert_type = uiTextBox15.Text;//人员证件类型 字符型 6
  138. jysc.certno = uiTextBox16.Text;//证件号码 字符型 50
  139. jysc.psn_name = uiTextBox17.Text;//人员姓名 字符型 50
  140. jysc.ipt_otp_no = uiTextBox18.Text;//住院/ 门诊号 字符型 30
  141. jysc.ipt_psn_sp_flag_type = uiTextBox19.Text;//住院人员特殊标识类型 字符型 6
  142. jysc.ipt_psn_sp_flag = uiTextBox20.Text;//住院人员特殊标识 字符型 6
  143. jysc.memo=uiTextBox22.Text;//备注
  144. jysc.admdvs = uiTextBox21.Text;//医保区划 字符型 6
  145. JObject data2 = new JObject();
  146. data2.Add("data", jysc);
  147. InvokeHelper invoker = new InvokeHelper();
  148. JObject joRtn = invoker.invokeCenterService("2406", JsonHelper.setCenterInpar("2406", data2.ToString()));
  149. if (JsonHelper.parseCenterRtnValue(joRtn, out string errMsg) != 0)
  150. {
  151. MessageBox.Show("查询出错:" + joRtn["err_msg"].ToString());
  152. }
  153. else
  154. {
  155. MessageBox.Show("上传成功!");
  156. }
  157. }
  158. private void uiTextBox23_TextChanged(object sender, EventArgs e)
  159. {
  160. }
  161. private void uiDatetimePicker1_ValueChanged(object sender, DateTime value)
  162. {
  163. }
  164. private void uiLabel31_Click(object sender, EventArgs e)
  165. {
  166. }
  167. private void uiButton5_Click(object sender, EventArgs e)
  168. {
  169. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  170. if (hBus.readCard(out string outParam) != 0)
  171. {
  172. MessageBox.Show("读卡失败!" + outParam);
  173. }
  174. else
  175. {
  176. //展示患者信息界面
  177. if (hBus.showPatInfo(outParam, out outParam) != 0)
  178. {
  179. MessageBox.Show(outParam);
  180. }
  181. else
  182. {
  183. }
  184. if (hBus.setGlobalPatAfaterShowPatInfo(outParam, out string errMsg) != 0)
  185. {
  186. }
  187. uiTextBox23.Text = Global.pat.psn_no;
  188. uiTextBox24.Text = Global.pat.insuType;
  189. }
  190. }
  191. private void uiButton6_Click(object sender, EventArgs e)
  192. {
  193. string Yllb = "";
  194. if (uiComboBox1.SelectedIndex == 0)
  195. {
  196. Yllb = "11";
  197. }
  198. else if (uiComboBox1.SelectedIndex == 1)
  199. {
  200. Yllb = "110104";
  201. }
  202. else if (uiComboBox1.SelectedIndex == 2)
  203. {
  204. Yllb = "21";
  205. }
  206. //人员待遇享受检查
  207. string errMsg = "";
  208. JObject joData2001 = new JObject();
  209. joData2001.Add("psn_no", uiTextBox23.Text);
  210. joData2001.Add("insutype", uiTextBox24.Text);
  211. joData2001.Add("fixmedins_code", Global.inf.hospitalNO);
  212. joData2001.Add("med_type", Yllb);
  213. joData2001.Add("begntime", uiDatetimePicker1.Text);
  214. joData2001.Add("endtime", uiDatetimePicker2.Text);
  215. joData2001.Add("dise_codg", "");
  216. joData2001.Add("dise_name", "");
  217. joData2001.Add("oprn_oprt_code", "");
  218. joData2001.Add("oprn_oprt_name", "");
  219. joData2001.Add("matn_type", "");
  220. joData2001.Add("birctrl_type", "");
  221. joData2001.Add("exp_content", "");
  222. JObject joInput = new JObject();
  223. joInput.Add("data", joData2001);
  224. InvokeHelper invoker = new InvokeHelper();
  225. JObject joRtn2001 = invoker.invokeCenterService("2001", JsonHelper.setCenterInpar("2001", joInput));
  226. JObject OutIDInfo = new JObject();
  227. JArray joDic;
  228. if (JsonHelper.parseCenterRtnValue(joRtn2001, out errMsg) != 0)
  229. {
  230. MessageBox.Show("人员待遇享受检查调用失败,中心返回错误信息:" + errMsg);
  231. }
  232. else
  233. {
  234. JArray joTrtinfo = JArray.Parse(JsonHelper.getDestValue(joRtn2001, "output.trtinfo"));
  235. // MessageBox.Show("获取到返回值数组" + joTrtinfo.ToString());
  236. // MessageBox.Show("数组数量" + joTrtinfo.Count);
  237. if (joTrtinfo.Count > 0)
  238. {
  239. for (int i = 0; i < joTrtinfo.Count; i++)
  240. {
  241. OutIDInfo = rIS.getSpecDictionaryValue(Global.inf.interfaceDr.ToString(), "fund_pay_type", joRtn2001["output"]["trtinfo"][i]["fund_pay_type"].ToString());
  242. joDic = JArray.Parse(JsonHelper.getDestValue(OutIDInfo, "result.data"));
  243. if (joDic.Count > 1)
  244. {
  245. joRtn2001["output"]["trtinfo"][i]["fund_pay_type"] = joDic[1]["name"].ToString();
  246. }
  247. }
  248. }
  249. //MessageBox.Show("转换后数据" + joRtn2001["output"]["trtinfo"].ToString());
  250. DataTable dt = (DataTable)joRtn2001["output"]["trtinfo"].ToObject(typeof(DataTable));
  251. grdSetter.SetTreatmentEnjoyVerify(DGV2001);
  252. DGV2001.DataSource = dt;
  253. }
  254. }
  255. }
  256. }