SpecialDrugSelect.cs 5.2 KB

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