IPFeeUploadProcess.cs 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. using Newtonsoft.Json.Linq;
  2. using PTMedicalInsurance.Helper;
  3. using PTMedicalInsurance.Variables;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace PTMedicalInsurance.Business
  11. {
  12. /// <summary>
  13. /// 住院费用明细上传
  14. /// </summary>
  15. class InpatientFeeUploadProcess : AbstractProcess
  16. {
  17. public override CallResult Process(JObject input)
  18. {
  19. string errMsg = "";
  20. //从医保平台获取患者详细的医保登记信息
  21. if (mIS.queryRegisterInfo(1, out outParam) != 0)
  22. {
  23. return Exception("查询患者云平台登记信息", outParam);
  24. }
  25. JObject joReg = JObject.Parse(outParam);
  26. Global.pat.medType = JsonHelper.getDestValue(joReg, "data.MedicalType");
  27. Global.pat.insuType = JsonHelper.getDestValue(joReg, "data.InsuType");
  28. //先取消中心费用传送
  29. cBus.cancleFeeUpload(TradeEnum.InpatientFeeCancel, out errMsg);
  30. //再删除医保传送表的数据
  31. mIS.deleteFee(out errMsg);
  32. #region【住院费用上传前调用3101事前服务】
  33. ////事前分析
  34. //if (Global.curEvt.ext.isOpenAnalysis)
  35. //{
  36. // if (hBus.PreAnalysis("4", "", out errMsg) != 0)
  37. // {
  38. // return Exception("事前分析", errMsg);
  39. // }
  40. //}
  41. if (Global.curEvt.ext.isOpenAnalysis)
  42. {
  43. if (hBus.PreAnalysis("4", "", out errMsg) != 0)
  44. {
  45. //rtnResult = JsonHelper.setExceptionJson(-1, "事前分析", errMsg).ToString();
  46. //return rtnResult;
  47. DialogResult dr = MessageBox.Show("【3101】医保明细审核事前分析服务医保中心返回结果:" + errMsg + "!是否继续?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  48. if (dr != DialogResult.OK)
  49. {
  50. return Exception("事前分析", JsonHelper.setExceptionJson(-1, "【3101】医保明细审核事前分析服务调用失败:", errMsg).ToString());
  51. }
  52. }
  53. }
  54. #endregion
  55. //开始进行费用传送
  56. //调用HIS费用查询信息
  57. if (hIS.getHisFee(Global.pat, out outParam) != 0)
  58. {
  59. return Exception("获取HIS费用", outParam);
  60. }
  61. //调用医保平台转换
  62. JObject joHisFee = JObject.Parse(outParam);
  63. if (mIS.convertHisFeeWithInsuCode(joHisFee, out outParam) != 0)
  64. {
  65. return Exception("转换HIS费用", outParam);
  66. }
  67. JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
  68. //按指定条数分割后上传,保存,更新
  69. if (hBus.uploadFeeToCenter(TradeEnum.InpatientFeeUpload, 50, jaFeeDetail, out outParam) != 0)
  70. {
  71. return Exception("上传费用", outParam);
  72. }
  73. else
  74. {
  75. return IrisReturn("住院费用上传成功", null);
  76. }
  77. }
  78. }
  79. }