IPFeeUploadProcess.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. //从医保平台获取患者详细的医保登记信息
  20. if (mIS.queryRegisterInfo(1, out outParam) != 0)
  21. {
  22. return Exception("查询患者云平台登记信息", outParam);
  23. }
  24. JObject joReg = JObject.Parse(outParam);
  25. Global.pat.medType = JsonHelper.getDestValue(joReg, "data.MedicalType");
  26. Global.pat.insuType = JsonHelper.getDestValue(joReg, "data.InsuType");
  27. //先取消中心费用传送
  28. cBus.cancleFeeUpload(TradeEnum.InpatientFeeCancel, out errMsg);
  29. //再删除医保传送表的数据
  30. mIS.deleteFee(out errMsg);
  31. #region【住院费用上传前调用3101事前服务】
  32. ////事前分析
  33. if (Global.curEvt.ext.isOpenAnalysis)
  34. {
  35. Global.pat.insuplc_admdvs = "370102";
  36. Global.inf.areaCode = "370102";
  37. //1.门诊挂号 2.门诊收费登记 3.住院登记 4.住院收费登记 5.住院执行医嘱 6.门诊结算 7.门诊预结算 8.住院结算 9.住院预结算 10.购药划卡
  38. if (hBus.PreAnalysis("9", "", out errMsg) != 0)
  39. {
  40. return Exception("事前分析", errMsg);
  41. }
  42. }
  43. #endregion
  44. //开始进行费用传送
  45. //调用HIS费用查询信息
  46. if (hIS.getHisFee(Global.pat, out outParam) != 0)
  47. {
  48. return Exception("获取HIS费用", outParam);
  49. }
  50. //调用医保平台转换
  51. JObject joHisFee = JObject.Parse(outParam);
  52. if (mIS.convertHisFeeWithInsuCode(joHisFee, out outParam) != 0)
  53. {
  54. return Exception("转换HIS费用", outParam);
  55. }
  56. JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
  57. //按指定条数分割后上传,保存,更新
  58. if (hBus.uploadFeeToCenter(TradeEnum.InpatientFeeUpload, 50, jaFeeDetail, out outParam) != 0)
  59. {
  60. return Exception("上传费用", outParam);
  61. }
  62. else
  63. {
  64. return IrisReturn("住院费用上传成功", null);
  65. }
  66. }
  67. }
  68. }