LocalMobilePayProcess.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. namespace PTMedicalInsurance.Business
  10. {
  11. class LocalMobilePayProcess : AbstractProcess
  12. {
  13. public override CallResult Process(JObject input)
  14. {
  15. string errMsg = "";
  16. //从医保平台获取患者详细的医保登记信息
  17. if (mIS.queryRegisterInfo(1, out outParam) != 0)
  18. {
  19. return Exception("查询患者云平台登记信息", outParam);
  20. }
  21. JObject joReg = JObject.Parse(outParam);
  22. Global.pat.medType = JsonHelper.getDestValue(joReg, "data.MedicalType");
  23. Global.pat.insuType = JsonHelper.getDestValue(joReg, "data.InsuType");
  24. //先取消中心费用传送
  25. cBus.cancleFeeUpload(TradeEnum.InpatientFeeCancel, out errMsg);
  26. //再删除医保传送表的数据
  27. mIS.deleteFee(out errMsg);
  28. #region【住院费用上传前调用3101事前服务】
  29. ////事前分析
  30. if (Global.curEvt.ext.isOpenAnalysis)
  31. {
  32. if (hBus.PreAnalysis("4", "", out errMsg) != 0)
  33. {
  34. return Exception("事前分析", errMsg);
  35. }
  36. }
  37. #endregion
  38. //开始进行费用传送
  39. //调用HIS费用查询信息
  40. if (hIS.getHisFee(Global.pat, out outParam) != 0)
  41. {
  42. return Exception("获取HIS费用", outParam);
  43. }
  44. //调用医保平台转换
  45. JObject joHisFee = JObject.Parse(outParam);
  46. if (mIS.convertHisFeeWithInsuCode(joHisFee, out outParam) != 0)
  47. {
  48. return Exception("转换HIS费用", outParam);
  49. }
  50. JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
  51. jaFeeDetail.ToList().ForEach((fee) =>
  52. {
  53. fee["chrg_bchno"] = Global.pat.adm_Dr.ToString();
  54. fee["med_type"] = Global.pat.medType;
  55. });
  56. outParam = JsonHelper.toJsonString(jaFeeDetail);
  57. return Success();
  58. }
  59. }
  60. }