SettlementBilllist.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. using Newtonsoft.Json.Linq;
  2. using PTMedicalInsurance.Common;
  3. using PTMedicalInsurance.FormSetter;
  4. using PTMedicalInsurance.Helper;
  5. using PTMedicalInsurance.Variables;
  6. using System;
  7. using System.Data;
  8. using System.Windows.Forms;
  9. namespace PTMedicalInsurance.Forms
  10. {
  11. public partial class SettlementBillPrint : Form
  12. {
  13. private int hospitalDr;
  14. private int interfaceDr;
  15. private string hospitalNO;
  16. private string interfaceNO;
  17. private string hospitalName;
  18. private string hospitalAreaCode;
  19. private InvokeHelper invoker = new InvokeHelper();
  20. public SettlementBillPrint()
  21. {
  22. InitializeComponent();
  23. hospitalDr = Global.inf.hospitalDr;
  24. hospitalNO = Global.inf.hospitalNO;
  25. hospitalName = Global.inf.hospitalName;
  26. hospitalAreaCode = Global.inf.areaCode;
  27. interfaceDr = Global.inf.interfaceDr;
  28. }
  29. public SettlementBillPrint(JObject joParam)
  30. {
  31. InitializeComponent();
  32. hospitalDr = Global.inf.hospitalDr;
  33. hospitalNO = Global.inf.hospitalNO;
  34. hospitalName = Global.inf.hospitalName;
  35. hospitalAreaCode = Global.inf.areaCode;
  36. if (joParam == null) return;
  37. string setl_id = JsonHelper.getDestValue(joParam, "setl_id");
  38. if (setl_id == "")
  39. {
  40. MessageBox.Show("根据传入的结算编号为查询到相关信息,请手动输入查询!");
  41. return;
  42. }
  43. string sqlStr = "SELECT * FROM BS_MedInsuSettlement WHERE Hospital_Dr=" + Global.inf.hospitalDr;
  44. sqlStr = sqlStr + " and SettlementID='" + setl_id + "'";
  45. JObject joSqlstr = new JObject();
  46. joSqlstr.Add("sqlStr", sqlStr);
  47. JArray jaParam = new JArray();
  48. jaParam.Add(joSqlstr);
  49. JObject joSettlQuery = new JObject();
  50. joSettlQuery.Add("params", jaParam);
  51. joSettlQuery.Add("code", "09010059");
  52. InvokeHelper invoker = new InvokeHelper();
  53. JObject joRtn = invoker.invokeInsuService(joSettlQuery.ToString(), "查询结算信息");
  54. DataTable dt = (DataTable)joRtn["result"]["data"].ToObject(typeof(DataTable));
  55. dgvSettlRecord.DataSource = dt;
  56. }
  57. private void SettlementBillPrint_Load(object sender, EventArgs e)
  58. {
  59. dpST.Text = DateTime.Now.ToString("yyyy-MM-dd 00:00:00");
  60. dpED.Text = DateTime.Now.ToString("yyyy-MM-dd 23:59:59");
  61. ComboxSetter cbxSetter = new ComboxSetter();
  62. cbxSetter.setCbxInterfaceDataSource(cbxInterface);
  63. GridViewSetter grdSetter = new GridViewSetter();
  64. grdSetter.SetHeaderTextOfSettlList(dgvSettlRecord);
  65. rbgAdmType.SelectedIndex = 0;
  66. rbgBillType.SelectedIndex = 1;
  67. //cbxInterface.SelectedValueChanged += new EventHandler(cbxInterface_SelectedValueChanged);
  68. }
  69. private void cbxInterface_SelectedValueChanged(object sender, EventArgs e)
  70. {
  71. DataTable dt = (DataTable)cbxInterface.DataSource;
  72. int i = cbxInterface.SelectedIndex;
  73. if (i >= 0)
  74. {
  75. //赋值
  76. hospitalNO = dt.Rows[i]["HospitalNO"].ToString();
  77. //MessageBox.Show(dt.Rows[i]["HospitalDr"].ToString());
  78. //MessageBox.Show(dt.Rows[i]["HospitalDr"].ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
  79. hospitalDr = int.Parse(dt.Rows[i]["HospitalDr"].ToString());
  80. interfaceNO = dt.Rows[i]["InterfaceNO"].ToString();
  81. interfaceDr = int.Parse(dt.Rows[i]["ID"].ToString());
  82. hospitalAreaCode = dt.Rows[i]["AreaCode"].ToString();
  83. //Global.inf.centerURL = dt.Rows[i]["CenterURL"].ToString();
  84. //Global.inf.businessDllName = dt.Rows[i]["DLLName"].ToString();
  85. //Global.inf.patientAreaCode = dt.Rows[i]["AreaCode"].ToString();
  86. }
  87. }
  88. private void btnClose_Click(object sender, EventArgs e)
  89. {
  90. Close();
  91. }
  92. private void btnQuery_Click(object sender, EventArgs e)
  93. {
  94. string sqlStr = " SELECT * FROM BS_MedInsuSettlement WHERE Hospital_Dr=" + hospitalDr;
  95. sqlStr = sqlStr + " and OccurTime>'" + dpST.Text + "'";
  96. sqlStr = sqlStr + " and OccurTime<'" + dpED.Text + "'";
  97. if (tbName.Text != "")
  98. {
  99. sqlStr = sqlStr + " and PatientName='" + tbName.Text + "'";
  100. }
  101. if (tbPatSettlID.Text != "")
  102. {
  103. sqlStr = sqlStr + " and SettlementID='" + tbPatSettlID.Text + "'";
  104. }
  105. if (tbHisNO.Text != "")
  106. {
  107. sqlStr = sqlStr + " and Adm_Dr='" + tbHisNO.Text + "'";
  108. }
  109. if (cbxInterface.Text != "")
  110. {
  111. sqlStr = sqlStr + " and Interface_Dr=" + Global.inf.interfaceDr + "";
  112. }
  113. if (rbgAdmType.SelectedIndex == 1)
  114. {
  115. sqlStr = sqlStr + " and AdmType=2";
  116. }
  117. if (rbgAdmType.SelectedIndex == 2)
  118. {
  119. sqlStr = sqlStr + " and AdmType=1";
  120. }
  121. if (rbgBillType.SelectedIndex == 1)
  122. {
  123. sqlStr = sqlStr + " and BillType=1 and ValidFlag=1 ";
  124. }
  125. if (rbgBillType.SelectedIndex == 2)
  126. {
  127. sqlStr = sqlStr + " and BillType=-1 and ValidFlag=0 ";
  128. }
  129. JObject joSqlstr = new JObject();
  130. joSqlstr.Add("sqlStr", sqlStr);
  131. JArray jaParam = new JArray();
  132. jaParam.Add(joSqlstr);
  133. JObject joSettlQuery = new JObject();
  134. joSettlQuery.Add("params", jaParam);
  135. joSettlQuery.Add("code", "09010059");
  136. JObject joRtn = invoker.invokeInsuService(joSettlQuery.ToString(), "查询结算信息");
  137. DataTable dt = (DataTable)joRtn["result"]["data"].ToObject(typeof(DataTable));
  138. dgvSettlRecord.DataSource = dt;
  139. }
  140. public void btnPrint_Click(object sender, EventArgs e)
  141. {
  142. if (dgvSettlRecord.RowCount <= 0)
  143. {
  144. MessageBox.Show("请先查询结算数据!");
  145. return;
  146. }
  147. try
  148. {
  149. int i = dgvSettlRecord.CurrentRow.Index;
  150. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  151. string AdmID = dt.Rows[i]["AdmID"].ToString();
  152. string SettlementID = dt.Rows[i]["SettlementID"].ToString();
  153. string ValidFlag = dt.Rows[i]["ValidFlag"].ToString();
  154. string MdtrtID = dt.Rows[i]["MdtrtID"].ToString();
  155. JObject joRtn = GetFastReportParams("", AdmID, MdtrtID, SettlementID, ValidFlag);
  156. if (JsonHelper.parseIrisRtnValue(joRtn, out string errMsg) != 0)
  157. {
  158. MessageBox.Show("获取FastReport入参失败:" + errMsg);
  159. return;
  160. }
  161. string sFastReportParam = JsonHelper.getDestValue(joRtn, "result");
  162. if (FastReportPrint(sFastReportParam, out errMsg) != 0)
  163. {
  164. MessageBox.Show("调用FastReport打印失败!" + errMsg);
  165. return;
  166. }
  167. }
  168. catch (Exception ex)
  169. {
  170. MessageBox.Show(ex.Message);
  171. return;
  172. }
  173. }
  174. public void btnDesign_Click(object sender, EventArgs e)
  175. {
  176. if (dgvSettlRecord.RowCount <= 0)
  177. {
  178. MessageBox.Show("请先查询结算数据!");
  179. return;
  180. }
  181. try
  182. {
  183. string errMsg;
  184. int i = dgvSettlRecord.CurrentRow.Index;
  185. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  186. string AdmID = dt.Rows[i]["AdmID"].ToString();
  187. string SettlementID = dt.Rows[i]["SettlementID"].ToString();
  188. string ValidFlag = dt.Rows[i]["ValidFlag"].ToString();
  189. string MdtrtID = dt.Rows[i]["MdtrtID"].ToString();
  190. string PsnNo = dt.Rows[i]["PersonnelNO"].ToString();
  191. //更新医保费用明细表
  192. //JObject joRtnFee = UpdateMedInsuUploadData(AdmID, PsnNo, MdtrtID, SettlementID);
  193. //if (JsonHelper.parseIrisRtnValue(joRtnFee, out errMsg) != 0)
  194. //{
  195. // MessageBox.Show("更新医保费用明细表失败:" + errMsg);
  196. // return;
  197. //}
  198. JObject joRtn = GetFastReportParams("Y", AdmID, MdtrtID, SettlementID, ValidFlag);
  199. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  200. {
  201. MessageBox.Show("获取FastReport入参失败:" + errMsg);
  202. return;
  203. }
  204. string sFastReportParam = JsonHelper.getDestValue(joRtn, "result");
  205. if (FastReportPrint(sFastReportParam, out errMsg) != 0)
  206. {
  207. MessageBox.Show("调用FastReport设计失败!" + errMsg);
  208. return;
  209. }
  210. }
  211. catch (Exception ex)
  212. {
  213. MessageBox.Show(ex.Message);
  214. return;
  215. }
  216. }
  217. public int FastReportPrint(string InParams,out string OutMsg)
  218. {
  219. Global.writeLog("调用FastReport入参:" + InParams);
  220. try
  221. {
  222. #region【调用正版FastReport打印】
  223. FastReportFrom.FastReportDll FrDll = new FastReportFrom.FastReportDll();
  224. string sRtnFr = FrDll.FastReport(InParams);
  225. JObject joRetObj = JObject.Parse(sRtnFr);
  226. if (JsonHelper.parseIrisRtnValue(joRetObj, out string errMsg) != 0)
  227. {
  228. OutMsg = "调用FastReport打印失败!" + errMsg;
  229. return -1;
  230. }
  231. else
  232. {
  233. OutMsg = "";
  234. return 0;
  235. }
  236. #endregion
  237. }
  238. catch (Exception ex)
  239. {
  240. OutMsg = "调用FastReport打印失败!" + ex.Message;
  241. return -1;
  242. }
  243. }
  244. public JObject GetFastReportParams(string designFlag, string admID, string MdtrtID, string settlementID, string validFlag)
  245. {
  246. try
  247. {
  248. if (designFlag == "") { designFlag = "N"; }
  249. #region【获取HIS医保结算信息】
  250. JObject joSettel = new JObject();
  251. joSettel.Add("HospitalDr", Global.inf.hospitalDr);
  252. joSettel.Add("interfaceDr", Global.inf.interfaceDr);
  253. joSettel.Add("admID", admID);
  254. joSettel.Add("SettlementID", settlementID);
  255. joSettel.Add("ValidFlag", validFlag);
  256. joSettel.Add("MdtrtID", MdtrtID);
  257. JObject joRtnSettle = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010066", joSettel).ToString(), "获取结算单信息");
  258. if (JsonHelper.parseIrisRtnValue(joRtnSettle, out string errMsg) != 0)
  259. {
  260. JObject joRtnSet = new JObject();
  261. joRtnSet.Add("errorCode", -1);
  262. joRtnSet.Add("errorMessage", errMsg);
  263. joRtnSet.Add("result", "");
  264. return joRtnSet;
  265. }
  266. #endregion
  267. #region【组织FastReport调用入参】
  268. JArray jachargeItemLvFee = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.chargeItemLvFee"));
  269. JArray jaClassification = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.classification"));
  270. JArray jaSettlement = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement"));
  271. JArray jaReginfo = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.reginfo"));
  272. JArray japatinsuinfo = JArray.Parse(JsonHelper.getDestValue(joRtnSettle, "result.data.patinsuinfo"));
  273. //转换金额大写
  274. string Sumamt = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].Sumamt").ToString());
  275. string ActualPayDeductible = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].ActualPayDeductible").ToString());
  276. string PersonCashPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].PersonCashPay").ToString());
  277. string AccountPaySumamt = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountPaySumamt").ToString());
  278. string FundPaySumamt = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].FundPaySumamt").ToString());
  279. string LargeExpensesSupplementPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].LargeExpensesSupplementPay").ToString());
  280. string SeriousIllnessPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].SeriousIllnessPay").ToString());
  281. string CivilserviceAllowancePay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].CivilserviceAllowancePay").ToString());
  282. string MedicalAssistPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].MedicalAssistPay").ToString());
  283. string OtherPay = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].OtherPay").ToString());
  284. string HospitalPartAmount = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HospitalPartAmount").ToString());
  285. string AccountMutualAidAmount = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].AccountMutualAidAmount").ToString());
  286. string InPolicyRangeAmount = FastReportFunction.MoneyToUpper(JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].InPolicyRangeAmount").ToString());
  287. //string BeginDate = JsonHelper.getDestValue(joRtnSettle, "result.data.reginfo[0].RegDate").ToString();
  288. //string EndDate = JsonHelper.getDestValue(joRtnSettle, "result.data.settlement[0].HISDischargeTime").ToString();
  289. //string InHosDays = FastReportFunction.DateDiff(Convert.ToDateTime(BeginDate), Convert.ToDateTime(EndDate));
  290. JObject jaAmountChiness = new JObject();
  291. jaAmountChiness.Add("Sumamt", Sumamt);
  292. jaAmountChiness.Add("ActualPayDeductible", ActualPayDeductible);
  293. jaAmountChiness.Add("PersonCashPay", PersonCashPay);
  294. jaAmountChiness.Add("AccountPaySumamt", AccountPaySumamt);
  295. jaAmountChiness.Add("FundPaySumamt", FundPaySumamt);
  296. jaAmountChiness.Add("LargeExpensesSupplementPay", LargeExpensesSupplementPay);
  297. jaAmountChiness.Add("SeriousIllnessPay", SeriousIllnessPay);
  298. jaAmountChiness.Add("CivilserviceAllowancePay", CivilserviceAllowancePay);
  299. jaAmountChiness.Add("MedicalAssistPay", MedicalAssistPay);
  300. jaAmountChiness.Add("OtherPay", OtherPay);
  301. jaAmountChiness.Add("HospitalPartAmount", HospitalPartAmount);
  302. jaAmountChiness.Add("AccountMutualAidAmount", AccountMutualAidAmount);
  303. jaAmountChiness.Add("InPolicyRangeAmount",InPolicyRangeAmount); //合规费用
  304. jaAmountChiness.Add("SettlOpter", Global.user.name);
  305. JArray jachinessParams = new JArray();
  306. jachinessParams.Add(jaAmountChiness);
  307. JObject joDataResult = new JObject();
  308. joDataResult.Add("SettlementInfo", jaSettlement);
  309. joDataResult.Add("ChargeItemLvFee", jachargeItemLvFee);
  310. joDataResult.Add("ClassificationInfo", jaClassification);
  311. joDataResult.Add("RegInfo", jaReginfo);
  312. joDataResult.Add("Patinsuinfo", japatinsuinfo);
  313. joDataResult.Add("ChinessSummat", jachinessParams);
  314. JObject joParams = new JObject();
  315. joParams.Add("fastReportCode", "SP11"); //这个要从表取值
  316. joParams.Add("hospID", Global.inf.hisHospitalDr.ToString());
  317. joParams.Add("printCode", Global.inf.interfaceDr.ToString());
  318. joParams.Add("templateID", "");
  319. JArray jaParams = new JArray();
  320. jaParams.Add(joParams);
  321. JObject joReportParams = new JObject();
  322. joReportParams.Add("params", jaParams);
  323. joReportParams.Add("code", "01040306");
  324. JObject joParam = new JObject();
  325. joParam.Add("designFlag", designFlag);
  326. joParam.Add("logFlag", "N");
  327. joParam.Add("dataParams", "");
  328. joParam.Add("pdfName", "");
  329. joParam.Add("reportparams", joReportParams);
  330. joParam.Add("dataResult", joDataResult);
  331. JObject joDataURL = new JObject();
  332. joDataURL.Add("dataIP", Global.hisConfig.ip);
  333. joDataURL.Add("urlAddress", Global.hisConfig.url);
  334. joDataURL.Add("authorization", Global.hisConfig.authorization);
  335. joParam.Add("dataURL", joDataURL);
  336. JArray jaParam = new JArray();
  337. jaParam.Add(joParam);
  338. JObject joInparam = new JObject();
  339. joInparam.Add("params", JArray.FromObject(jaParam));
  340. joInparam.Add("session", Global.curEvt.jaSession);
  341. #endregion
  342. JObject joRtn = new JObject();
  343. joRtn.Add("errorCode", 0);
  344. joRtn.Add("errorMessage", "");
  345. joRtn.Add("result", joInparam.ToString());
  346. return joRtn;
  347. }
  348. catch (Exception ex)
  349. {
  350. JObject joRtnEx = new JObject();
  351. joRtnEx.Add("errorCode", -1);
  352. joRtnEx.Add("errorMessage", ex.Message);
  353. joRtnEx.Add("result", "");
  354. return joRtnEx;
  355. }
  356. }
  357. /// <summary>
  358. /// 【5204】费用明细查询更新医保费用上传记录表
  359. /// </summary>
  360. /// <returns></returns>
  361. public JObject UpdateMedInsuUploadData(string AdmID, string psnNo, string MdtrtID, string SettlementID)
  362. {
  363. string errorMsg, outParam;
  364. if (AdmID == "")
  365. {
  366. return JObject.Parse(JsonHelper.setExceptionJson(-1, "", "AdmID不能为空!").ToString());
  367. }
  368. if (psnNo == "")
  369. {
  370. return JObject.Parse(JsonHelper.setExceptionJson(-1, "", "psnNo不能为空!").ToString());
  371. }
  372. if (MdtrtID == "")
  373. {
  374. return JObject.Parse(JsonHelper.setExceptionJson(-1, "", "MdtrtID不能为空!").ToString());
  375. }
  376. if (SettlementID == "")
  377. {
  378. return JObject.Parse(JsonHelper.setExceptionJson(-1, "", "settlementID不能为空!").ToString());
  379. }
  380. if (Global.inf.hospitalDr.ToString() == "")
  381. {
  382. return JObject.Parse(JsonHelper.setExceptionJson(-1, "", "hospitalDr不能为空!").ToString());
  383. }
  384. try
  385. {
  386. #region【5204】费用明细查询
  387. JObject joData = new JObject();
  388. joData.Add("psn_no", psnNo);
  389. joData.Add("setl_id", SettlementID);
  390. joData.Add("mdtrt_id", MdtrtID);
  391. JObject joInput = new JObject();
  392. joInput.Add("data", joData);
  393. JObject joRtn5204 = invoker.invokeCenterService(TradeEnum.InsuFeeUpdate, joInput);
  394. if (JsonHelper.parseCenterRtnValue(joRtn5204, out errorMsg) != 0)
  395. {
  396. outParam = JsonHelper.setExceptionJson(-1, "【5204】费用明细查询失败!", errorMsg).ToString();
  397. return JObject.Parse(outParam);
  398. }
  399. #endregion
  400. JArray jaRtn5204 = JArray.Parse(JsonHelper.getDestValue(joRtn5204, "output"));
  401. if (jaRtn5204.Count <= 0)
  402. {
  403. return JObject.Parse(JsonHelper.setExceptionJson(-1, "", "【5204】医保费用明细查询返回结果为空!").ToString());
  404. }
  405. dynamic joTmp = new JObject();
  406. joTmp.code = "09010090";
  407. JArray jaParams = jaRtn5204;
  408. joTmp.Add("params", jaParams);
  409. joTmp.HospitalDr = Global.inf.hospitalDr;
  410. joTmp.InterfaceDr = Global.inf.InsuCurrencyCataLogue; //如果是通用目录就更新通用目录
  411. joTmp.admID = AdmID;
  412. joTmp.mdtrt_id = MdtrtID;
  413. joTmp.psn_no = psnNo;
  414. joTmp.updateUserID = Global.user.ID;
  415. JObject joRtn = invoker.invokeInsuService(joTmp.ToString(), "更新医保费用上传明细表");
  416. if (JsonHelper.parseIrisRtnValue(joRtn, out errorMsg) != 0)
  417. {
  418. outParam = JsonHelper.setExceptionJson(-1, "更新医保费用上传明细表失败!", errorMsg).ToString();
  419. return JObject.Parse(outParam);
  420. }
  421. else
  422. {
  423. return joRtn;
  424. }
  425. }
  426. catch (Exception ex)
  427. {
  428. JObject joRtnEx = new JObject();
  429. joRtnEx.Add("errorCode", -1);
  430. joRtnEx.Add("errorMessage", ex.Message);
  431. return joRtnEx;
  432. }
  433. }
  434. private JObject getPatCheckList()
  435. {
  436. try
  437. {
  438. int i = dgvSettlRecord.CurrentRow.Index;
  439. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  440. JObject joSettel = new JObject();
  441. joSettel.Add("HospitalDr", Global.inf.hospitalDr);
  442. joSettel.Add("interfaceDr", Global.inf.interfaceDr);
  443. joSettel.Add("admID", dt.Rows[i]["AdmID"].ToString());
  444. joSettel.Add("SettlementID", dt.Rows[i]["SettlementID"].ToString());
  445. joSettel.Add("ValidFlag", dt.Rows[i]["ValidFlag"].ToString());
  446. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010066", joSettel).ToString(), "获取结算单信息");
  447. return joRtn;
  448. }
  449. catch (Exception ex)
  450. {
  451. JObject joRtn = new JObject();
  452. joRtn.Add("errorCode", -1);
  453. joRtn.Add("errorMessage", ex.Message);
  454. return joRtn;
  455. }
  456. }
  457. private void btn_UpdateMedInsuFee_Click(object sender, EventArgs e)
  458. {
  459. string errorMsg;
  460. if (dgvSettlRecord.RowCount <= 0)
  461. {
  462. MessageBox.Show("请先查询结算数据!");
  463. return;
  464. }
  465. int i = dgvSettlRecord.CurrentRow.Index;
  466. DataTable dt = (DataTable)dgvSettlRecord.DataSource;
  467. string AdmID = dt.Rows[i]["AdmID"].ToString();
  468. string SettlementID = dt.Rows[i]["SettlementID"].ToString();
  469. string MdtrtID = dt.Rows[i]["MdtrtID"].ToString();
  470. string PsnNo = dt.Rows[i]["PersonnelNO"].ToString();
  471. #region【5204】1.医保费用明细查询 2.更新医保平台费用上传明细表
  472. JObject joRtnFee = UpdateMedInsuUploadData(AdmID, PsnNo, MdtrtID, SettlementID);
  473. if (JsonHelper.parseIrisRtnValue(joRtnFee, out errorMsg) != 0)
  474. {
  475. MessageBox.Show("更新医保费用明细表失败:" + errorMsg);
  476. return;
  477. }
  478. else
  479. {
  480. MessageBox.Show("更新医保费用明细表成功");
  481. }
  482. #endregion
  483. }
  484. }
  485. }