SettlementBilllist.cs 25 KB

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