IPFeeUploadProcess.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. /// <summary>
  12. /// 住院费用明细上传
  13. /// </summary>
  14. class InpatientFeeUploadProcess : AbstractProcess
  15. {
  16. public override CallResult Process(JObject input)
  17. {
  18. string errMsg = "";
  19. Global.pat.admType = 2;
  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. #endregion
  42. //开始进行费用传送
  43. //调用HIS费用查询信息
  44. if (hIS.getHisFee(Global.pat, out outParam) != 0)
  45. {
  46. return Exception("获取HIS费用", outParam);
  47. }
  48. //调用医保平台转换
  49. JObject joHisFee = JObject.Parse(outParam);
  50. if (mIS.convertHisFeeWithInsuCode(joHisFee, out outParam) != 0)
  51. {
  52. return Exception("转换HIS费用", outParam);
  53. }
  54. JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
  55. //按指定条数分割后上传,保存,更新
  56. if (hBus.uploadFeeToCenter(TradeEnum.InpatientFeeUpload, 50, jaFeeDetail, out outParam) != 0)
  57. {
  58. return Exception("上传费用", outParam);
  59. }
  60. else
  61. {
  62. return IrisReturn("住院费用上传成功", null);
  63. }
  64. }
  65. }
  66. }