LocalMobilePayProcess.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Newtonsoft.Json.Linq;
  2. using PTMedicalInsurance.Common;
  3. using PTMedicalInsurance.Helper;
  4. using PTMedicalInsurance.Variables;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace PTMedicalInsurance.Business
  11. {
  12. class LocalMobilePayProcess : AbstractProcess
  13. {
  14. public override CallResult Process(JObject input)
  15. {
  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. //调用HIS费用查询信息
  26. if (hIS.getHisFee(Global.pat, out outParam) != 0)
  27. {
  28. return Exception("获取HIS费用", outParam);
  29. }
  30. //调用医保平台转换
  31. JObject joHisFee = JObject.Parse(outParam);
  32. if (mIS.convertHisFeeWithInsuCode(joHisFee, out outParam) != 0)
  33. {
  34. return Exception("转换HIS费用", outParam);
  35. }
  36. JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
  37. jaFeeDetail.ToList().ForEach((fee) =>
  38. {
  39. fee["chrg_bchno"] = Global.pat.adm_Dr.ToString();
  40. fee["med_type"] = Global.pat.medType;
  41. });
  42. JObject joInput = new JObject();
  43. joInput.Add("feedetail", jaFeeDetail);
  44. JObject joOutput = Utils.ConvertRequest<JObject>(TradeEnum.MobilePayOrder, joInput);
  45. outParam = JsonHelper.toJsonString(joOutput);
  46. return Success();
  47. }
  48. }
  49. }