SpecialDrugSelect.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. using Newtonsoft.Json.Linq;
  2. using PTMedicalInsurance.Helper;
  3. using PTMedicalInsurance;
  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.Common;
  15. namespace AnHuiMI.Forms
  16. {
  17. public partial class SpecialDrugSelect : Form
  18. {
  19. public SpecialDrugSelect()
  20. {
  21. InitializeComponent();
  22. }
  23. InvokeHelper invoker = new InvokeHelper();
  24. private void uiButton3_Click(object sender, EventArgs e)
  25. {
  26. //人员慢特病用药记录数据查询接口
  27. JObject Joinput= new JObject();
  28. JObject JoParms= new JObject();
  29. JoParms.Add("psnNo", uiTextBox5.Text);
  30. JoParms.Add("psnNo", Global.pat.psn_no);
  31. JoParms.Add("begnTime", uiDatetimePicker3.Text);
  32. JoParms.Add("endTime", uiDatetimePicker4.Text);
  33. Joinput.Add("Code", "feeListOpsp");
  34. Joinput.Add("pageNum", uiTextBox1.Text);
  35. Joinput.Add("pageSize", uiTextBox2.Text);
  36. Joinput.Add("queryParms", JoParms);
  37. JObject joOpspRtn = invoker.invokeMBCenterService("feeListOpsp", JsonHelper.setCenterInparMB("feeListOpsp", Joinput));
  38. if (JsonHelper.getDestValue(joOpspRtn, "msg") != "查询成功")
  39. {
  40. MessageBox.Show("人员慢特病用药记录查询失败");
  41. return;
  42. }
  43. JObject joOutput = JObject.Parse(JsonHelper.getDestValue(joOpspRtn, "data"));
  44. JArray joIDInfo = JArray.Parse(JsonHelper.getDestValue(joOutput, "rows"));
  45. //if (joIDInfo.Count > 0)
  46. //{
  47. // for (int i = 0; i < joIDInfo.Count; i++)
  48. // {
  49. // Utils.convertTimestamp((JObject)joIDInfo[i], "fee_ocur_time");
  50. // }
  51. //}
  52. //dgv5205.DataSource = (DataTable)joRtn["output"]["feedetail"].ToObject(typeof(DataTable));
  53. uiDataGridView2.DataSource = (DataTable)joIDInfo.ToObject(typeof(DataTable));
  54. }
  55. private void uiButton1_Click(object sender, EventArgs e)
  56. {
  57. //人员慢特病用药记录数据统计接口
  58. JObject Joinput = new JObject();
  59. JObject JoParms = new JObject();
  60. JoParms.Add("psnNo", Global.pat.psn_no);
  61. JoParms.Add("begnTime", uiDatetimePicker1.Text);
  62. JoParms.Add("endTime", uiDatetimePicker2.Text);
  63. Joinput.Add("Code", "feeListOpspCount");
  64. Joinput.Add("pageNum", uiTextBox3.Text);
  65. Joinput.Add("pageSize", uiTextBox4.Text);
  66. Joinput.Add("queryParms", JoParms);
  67. JObject joOpspRtn = invoker.invokeMBCenterService("feeListOpspCount", JsonHelper.setCenterInparMB("feeListOpspCount", Joinput));
  68. if (JsonHelper.getDestValue(joOpspRtn, "msg") != "查询成功")
  69. {
  70. MessageBox.Show("人员慢特病用药记录查询失败" );
  71. return;
  72. }
  73. JObject joOutput = JObject.Parse(JsonHelper.getDestValue(joOpspRtn, "data"));
  74. JArray joIDInfo = JArray.Parse(JsonHelper.getDestValue(joOutput, "rows"));
  75. //if (joIDInfo.Count > 0)
  76. //{
  77. // for (int i = 0; i < joIDInfo.Count; i++)
  78. // {
  79. // Utils.convertTimestamp((JObject)joIDInfo[i], "fee_ocur_time");
  80. // }
  81. //}
  82. //dgv5205.DataSource = (DataTable)joRtn["output"]["feedetail"].ToObject(typeof(DataTable));
  83. uiDataGridView1.DataSource = (DataTable)joIDInfo.ToObject(typeof(DataTable));
  84. }
  85. private void uiPanel2_Click(object sender, EventArgs e)
  86. {
  87. }
  88. private void SpecialDrugSelect_Load(object sender, EventArgs e)
  89. {
  90. string outParam = "", errMsg = "";
  91. JObject joData = new JObject();
  92. JObject joInput = new JObject();
  93. JObject joRtn = new JObject();
  94. string errorMsg = "";
  95. joData.Add("mdtrt_cert_type", "02");
  96. joData.Add("mdtrt_cert_no", Global.pat.certNO);
  97. joData.Add("card_sn", "");
  98. joData.Add("begntime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  99. joData.Add("psn_cert_type", "01");
  100. joData.Add("certno", Global.pat.certNO); //证件号码
  101. joData.Add("psn_name", Global.pat.name);
  102. joInput.Add("data", joData);
  103. joRtn = invoker.invokeCenterService("1101", JsonHelper.setCenterInpar("1101", joInput));
  104. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) == 0)
  105. {
  106. outParam = joRtn.ToString();
  107. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(JObject.Parse(outParam), "output.insuinfo.insuplc_admdvs"); //参保地
  108. Global.pat.psn_no = JsonHelper.getDestValue(JObject.Parse(outParam), "output.baseinfo.psn_no"); //人员编号
  109. }
  110. else
  111. {
  112. MessageBox.Show("未查询到参保人员信息,请检查接口选择是否正确或电脑医保环境是否正常!");
  113. }
  114. }
  115. }
  116. }