UploadFee.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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.Core.SelfServiceMachine.Process.InPat
  10. {
  11. class UploadFee:AbstractProcess
  12. {
  13. public override CallResult Process(JObject input)
  14. {
  15. cBus.cancleRegister(TradeEnum.InpatientExitCancel, out errMsg);
  16. //从医保平台获取患者详细的医保登记信息
  17. if (mIS.queryRegisterInfo(1, out outParam) != 0)
  18. {
  19. outParam = JsonHelper.setExceptionJson(-1, "查询患者云平台登记信息", outParam).ToString();
  20. return Exception(outParam);
  21. }
  22. JObject joReg = JObject.Parse(outParam);
  23. Global.pat.medType = JsonHelper.getDestValue(joReg, "data.MedicalType");
  24. Global.pat.insuType = JsonHelper.getDestValue(joReg, "data.InsuType");
  25. //先取消中心费用传送
  26. cBus.cancleFeeUpload(TradeEnum.InpatientFeeCancel, out errMsg);
  27. //再删除医保传送表的数据
  28. mIS.deleteFee(out errMsg);
  29. //开始进行费用传送
  30. //调用HIS费用查询信息
  31. if (hIS.getHisFee(Global.pat, out outParam) != 0)
  32. {
  33. outParam = JsonHelper.setExceptionJson(-1, "获取HIS费用", outParam).ToString();
  34. return Exception(outParam);
  35. }
  36. //调用医保平台转换
  37. JObject joHisFee = JObject.Parse(outParam);
  38. if (mIS.convertHisFeeWithInsuCode(joHisFee, out outParam) != 0)
  39. {
  40. outParam = JsonHelper.setExceptionJson(-1, "转换HIS费用", outParam).ToString();
  41. return Exception(outParam);
  42. }
  43. JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
  44. //按指定条数分割后上传,保存,更新
  45. if (hBus.uploadFeeToCenter(TradeEnum.InpatientFeeUpload, 10, jaFeeDetail, out outParam) != 0)
  46. {
  47. outParam = JsonHelper.setExceptionJson(-1, "上传费用", outParam).ToString();
  48. return Exception(outParam);
  49. }
  50. else
  51. {
  52. outParam = JsonHelper.setIrisReturnValue(0, "住院费用上传成功", null).ToString();
  53. outParam = input.ToString();
  54. return Success();
  55. }
  56. }
  57. }
  58. }