InsuBusiness.cs 84 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795
  1. using Newtonsoft.Json.Linq;
  2. using PTMedicalInsurance.Business;
  3. using PTMedicalInsurance.Business.Core.SelfServiceMachine.ProcessScheduler;
  4. using PTMedicalInsurance.Common;
  5. using PTMedicalInsurance.Forms;
  6. using PTMedicalInsurance.Helper;
  7. using PTMedicalInsurance.Variables;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Data;
  11. using System.IO;
  12. using System.Linq;
  13. using System.Reflection;
  14. using System.Text;
  15. using System.Threading;
  16. using System.Threading.Tasks;
  17. using System.Windows.Forms;
  18. namespace PTMedicalInsurance
  19. {
  20. public class InsuBusiness : IInsuBusiness
  21. {
  22. //定义相关的变量
  23. //private Patients patient;
  24. //private Fees fee;
  25. //private Settlements settlement;
  26. //json对象属性
  27. private JObject joInParam;
  28. private JArray jaSession ;
  29. private JArray jaParams;
  30. private JObject joParam;
  31. private JObject joInterface;
  32. private JObject joInsuAdmObj;
  33. //设置业务实例
  34. CenterBusiness cBus = new CenterBusiness();
  35. HisMainBusiness hBus = new HisMainBusiness();
  36. HisIrisServices hIS = new HisIrisServices();
  37. MIIrisServices mIS= new MIIrisServices();
  38. InvokeHelper invoker = new InvokeHelper();
  39. //
  40. private string businessType;
  41. private string operationType;
  42. public InsuBusiness()
  43. {
  44. Global.curEvt.path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
  45. ComputerInfo comp = new ComputerInfo();
  46. Global.curEvt.mac = comp.GetMAC();
  47. Global.curEvt.ip = comp.GetIP();
  48. Global.pat.insuplc_admdvs = ""; //如果是NULL中心会报错
  49. }
  50. private int parseInparam(string inParam,out string errMsg)
  51. {
  52. errMsg = "";
  53. try
  54. {
  55. joInParam = JObject.Parse(inParam);
  56. jaSession = JArray.Parse(JsonHelper.getDestValue(joInParam, "session"));
  57. Global.curEvt.jaSession = jaSession;
  58. jaParams = JArray.Parse(JsonHelper.getDestValue(joInParam, "params"));
  59. joParam = JObject.FromObject(jaParams[0]);
  60. if (JsonHelper.getDestValue(joInParam, "insuAdmObj") != "")
  61. joInsuAdmObj = JObject.Parse(JsonHelper.getDestValue(joInParam, "insuAdmObj"));
  62. joInterface = JObject.Parse(JsonHelper.getDestValue(joInParam, "interfaceinfo"));
  63. businessType = JsonHelper.getDestValue(joInParam, "businessType");
  64. operationType = JsonHelper.getDestValue(joInParam, "operationType");
  65. if ((businessType == "M6") || (businessType == "M6C") || (businessType == "M6Confirm"))
  66. {
  67. //M6C退费只能在PC端退费?
  68. Environment.CurrentDirectory = @"D:\HttpServerAPI\bin";
  69. }
  70. if (JsonHelper.getDestValue(joInParam, "operationType") != "")
  71. {
  72. Global.operationType = (OperationType)Enum.Parse(typeof(OperationType), JsonHelper.getDestValue(joInParam, "operationType"));
  73. }
  74. return 0;
  75. }
  76. catch (Exception ex)
  77. {
  78. errMsg = "parseInparam 解析入参异常:" + ex.Message;
  79. return -1;
  80. }
  81. }
  82. /// <summary>
  83. /// 签到
  84. /// </summary>
  85. /// <param name="InParam"></param>
  86. /// <returns></returns>
  87. public string Init(string InParam)
  88. {
  89. string errMsg, rtnResult ="";
  90. JObject joRtn = new JObject();
  91. try
  92. {
  93. if (hBus.initEnvironment(InParam, out errMsg) != 0)
  94. {
  95. return JsonHelper.setExceptionJson(-100, "initEnvironment 失败", errMsg).ToString();
  96. }
  97. else
  98. {
  99. if (mIS.isSigned(ref Global.curEvt.signno) != true)
  100. {
  101. if (businessType != "BasicData")//如果是打开数据对照界面不调用初始化
  102. {
  103. //签到
  104. if (cBus.signIn(out joRtn) != 0)
  105. {
  106. rtnResult = JsonHelper.setExceptionJson(-1, "签到异常", (string)joRtn["err_msg"]).ToString();
  107. return rtnResult;
  108. }
  109. else
  110. {
  111. Global.curEvt.signno = JsonHelper.getDestValue(joRtn, "output.signinoutb.sign_no");
  112. //插入签到表
  113. if (mIS.saveSignRecord(Global.curEvt.signno, out errMsg) != 0)
  114. {
  115. rtnResult = JsonHelper.setIrisReturnValue(0, "中心签到成功但插入签到表失败:" + errMsg, null).ToString();
  116. }
  117. else
  118. {
  119. rtnResult = JsonHelper.setIrisReturnValue(0, "签到成功", joRtn).ToString();
  120. }
  121. }
  122. }
  123. else
  124. {
  125. Global.curEvt.signno = "ABC123";
  126. rtnResult = JsonHelper.setIrisReturnValue(0, "初始化成功(医保对照不初始化)!", null).ToString();
  127. }
  128. }
  129. else
  130. {
  131. rtnResult = JsonHelper.setIrisReturnValue(0, "初始化成功!", null).ToString();
  132. }
  133. return rtnResult;
  134. }
  135. }
  136. catch (Exception ex)
  137. {
  138. rtnResult = JsonHelper.setExceptionJson(-100, "Init 异常", ex.Message).ToString();
  139. return rtnResult;
  140. }
  141. finally
  142. {
  143. Global.writeLog("初始化结果:" + rtnResult);
  144. }
  145. }
  146. /// <summary>
  147. /// 初始化
  148. /// </summary>
  149. /// <param name="inParam"></param>
  150. /// <param name="outParam"></param>
  151. /// <returns></returns>
  152. private int init(string inParam, out string outParam)
  153. {
  154. string errMsg;
  155. outParam = "";
  156. try
  157. {
  158. //BS架构调用方式问题,每次调用都需要重新初始化
  159. JObject joInitRtn = JObject.Parse(Init(inParam));
  160. if (JsonHelper.parseIrisRtnValue(joInitRtn, out errMsg) != 0)
  161. {
  162. outParam = JsonHelper.setExceptionJson(-100, "init(HIS医保环境初始化)", errMsg).ToString();
  163. return -1;
  164. }
  165. else
  166. {
  167. return 0;
  168. }
  169. }
  170. catch (Exception ex)
  171. {
  172. outParam = JsonHelper.setExceptionJson(-100, "init(HIS医保环境初始化)异常", ex.Message).ToString();
  173. return -1;
  174. }
  175. }
  176. /// <summary>
  177. /// 获取患者信息
  178. /// </summary>
  179. /// <param name="InParam"></param>
  180. /// <returns></returns>
  181. public string GetPatientInfo(string InParam)
  182. {
  183. Global.writeLog("GetPatientInfo入参:" + JsonHelper.Compress(InParam));
  184. //设置返回值,错误信息
  185. int errCode;
  186. string errMsg, rtnResult = "",outParam;
  187. //BS架构调用方式问题,每次调用都需要重新初始化
  188. if (init(InParam,out outParam)!= 0)
  189. {
  190. rtnResult = outParam;
  191. return rtnResult;
  192. }
  193. JObject joInParam = JObject.Parse(InParam);
  194. string businessType = JsonHelper.getDestValue(joInParam,"businessType");
  195. try
  196. {
  197. switch (businessType)
  198. {
  199. case "M1"://门诊读卡
  200. {
  201. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  202. if (hBus.readCard(out outParam) != 0)
  203. {
  204. rtnResult = JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
  205. }
  206. else if (string.IsNullOrEmpty(outParam))
  207. {
  208. // 点击取消或关闭
  209. rtnResult = JsonHelper.setExceptionJson(-100, "读卡失败!", "读卡信息为空").ToString();
  210. }
  211. else
  212. {
  213. //展示患者信息界面
  214. if (hBus.showPatInfo(outParam, out outParam) != 0)
  215. {
  216. rtnResult = outParam;
  217. }
  218. else
  219. {
  220. rtnResult = JsonHelper.setIrisReturnValue(0, "", JObject.Parse(outParam)).ToString();
  221. }
  222. }
  223. break;
  224. }
  225. case "Z1"://住院读卡
  226. {
  227. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  228. if (hBus.readCard(out outParam) != 0)
  229. {
  230. rtnResult = JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
  231. }
  232. else
  233. {
  234. string patInfo = outParam;
  235. //展示患者信息界面
  236. if (hBus.showPatInfo(patInfo, out outParam) != 0)
  237. {
  238. rtnResult = outParam;
  239. }
  240. else
  241. {
  242. rtnResult = JsonHelper.setIrisReturnValue(0,"",JObject.Parse(outParam)).ToString();
  243. }
  244. }
  245. break;
  246. }
  247. }
  248. return rtnResult;
  249. }
  250. catch (Exception ex)
  251. {
  252. rtnResult = JsonHelper.setIrisReturnValue(-1 , "GetPatientInfo发生异常;" + ex.Message,null).ToString();
  253. return rtnResult;
  254. }
  255. finally
  256. {
  257. Global.writeLog("GetPatientInfo出参:" + JsonHelper.Compress(rtnResult));
  258. }
  259. }
  260. /// <summary>
  261. /// 登记
  262. /// </summary>
  263. /// <param name="InParam"></param>
  264. /// <returns></returns>
  265. public string Register(string InParam)
  266. {
  267. Global.writeLog("Register 入参:" + JsonHelper.Compress(InParam));
  268. //设置返回值,错误信息
  269. string errMsg, rtnResult = "", outParam;
  270. try
  271. {
  272. //解析入参
  273. if (parseInparam(InParam, out errMsg) != 0)
  274. {
  275. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  276. return rtnResult;
  277. }
  278. //BS架构调用方式问题,每次调用都需要重新初始化
  279. if (init(InParam, out outParam) != 0)
  280. {
  281. rtnResult = outParam;
  282. return rtnResult;
  283. }
  284. //获取pat
  285. hBus.GetRegPatInfo(businessType, joInParam, out Global.pat);
  286. switch (businessType)
  287. {
  288. case "M2"://门诊登记
  289. {
  290. string patInfo = "";
  291. errMsg = showPatientInfo(out patInfo, out outParam);
  292. if (!errMsg.Equals("0"))
  293. {
  294. return errMsg;
  295. }
  296. Global.writeLog("获取到病人信息:" + patInfo);
  297. JObject reg = JObject.Parse(patInfo);
  298. this.OutpatientReg(reg,patInfo);
  299. break;
  300. }
  301. case "M2C"://门诊登记撤销
  302. {
  303. break;
  304. }
  305. case "Z0"://住院修改
  306. {
  307. break;
  308. }
  309. case "Z2"://入院登记
  310. {
  311. Global.writeLog(Global.pat.insuType);
  312. string regInParam = "";
  313. //显示登记面板
  314. if (hBus.showInPatRegisterForm( out regInParam) == 0)
  315. {
  316. JObject joRegIn_plain = JObject.Parse(JsonHelper.setCenterInpar_plain("2401", regInParam));
  317. JObject joRegIn = JObject.Parse(JsonHelper.setCenterInpar("2401", regInParam));
  318. //上传给中心
  319. JObject joRegOut = invoker.invokeCenterService("2401", joRegIn);
  320. //将中心返回的结果返回HIS,调用HIS服务进行保存
  321. if (JsonHelper.parseCenterRtnValue(joRegOut,out errMsg) == 0)
  322. {
  323. joRegOut.Add("validflag",1);
  324. joRegOut.Add("regstate", 1);
  325. joRegOut.Add("type", 1);
  326. Global.pat.mdtrtID = JsonHelper.getDestValue(joRegOut, "output.result.mdtrt_id");
  327. //插入患者本次就诊用的参保信息
  328. if (hBus.insertPatCurInsuInfo(JsonHelper.getDestValue(joParam, "patientInfo"), out outParam) != 0)
  329. {
  330. if (DialogResult.Yes == MessageBox.Show(outParam, " 是否继续? ", MessageBoxButtons.YesNo))
  331. {
  332. }
  333. else
  334. {
  335. rtnResult = JsonHelper.setExceptionJson(-1, "插入患者本次就诊用的参保信息,请联系管理员!", outParam).ToString();
  336. return rtnResult;
  337. }
  338. }
  339. //插入医保平台
  340. if (mIS.saveInpatRegisterInfo(joRegIn_plain, joRegOut, out outParam) != 0)
  341. {
  342. rtnResult = JsonHelper.setExceptionJson(-1, "云平台保存登记信息", outParam).ToString();
  343. return rtnResult;
  344. }
  345. //返回登记信息,插入HIS
  346. if (hIS.returnRegisterInfo(joRegIn_plain, joRegOut, out outParam) != 0)
  347. {
  348. rtnResult = JsonHelper.setExceptionJson(-1, "HIS平台保存登记信息", outParam).ToString();
  349. return rtnResult;
  350. }
  351. else
  352. {
  353. rtnResult = JsonHelper.setIrisReturnValue(0, "登记成功", null).ToString();
  354. return rtnResult;
  355. }
  356. }
  357. else
  358. {
  359. rtnResult = JsonHelper.setExceptionJson(-1, "展示登记界面", errMsg).ToString();
  360. return rtnResult;
  361. }
  362. }
  363. else
  364. {
  365. rtnResult = JsonHelper.setExceptionJson(-1, "展示登记界面", regInParam).ToString();
  366. return rtnResult;
  367. }
  368. }
  369. case "Z2C"://入院登记取消
  370. {
  371. //if (DialogResult.Yes == MessageBox.Show("即将进行取消中心医保登记,确定继续吗?", " 询问? ", MessageBoxButtons.YesNo))
  372. //{
  373. //}
  374. //else
  375. //{
  376. // rtnResult = JsonHelper.setExceptionJson(-1, "收费员撤销取消登记操作!", outParam).ToString();
  377. // return rtnResult;
  378. //}
  379. //取消中心登记
  380. if (cBus.cancleRegister("2404", out outParam) != 0)
  381. {
  382. //如果医保中心没有HIS所传的医保登记信息则默认撤销HIS登记信息
  383. //int i = outParam.IndexOf("不存在有效的就诊登记信息");
  384. //if (i != 0)
  385. //{
  386. // if (DialogResult.Yes != MessageBox.Show("医保中心提示:" + outParam+ ",是否强制撤销HIS医保登记信息?", "提示", MessageBoxButtons.YesNo))
  387. // {
  388. // return rtnResult;
  389. // }
  390. //}
  391. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记失败,", outParam).ToString();
  392. return rtnResult;
  393. }
  394. //取消医保平台登记
  395. if (mIS.cancleRegister(1, out outParam) != 0)
  396. {
  397. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记成功,但云医保平台取消失败,", outParam).ToString();
  398. return rtnResult;
  399. }
  400. //取消HIS 登记
  401. if (hIS.cancleRegister( out outParam) != 0)
  402. {
  403. rtnResult = JsonHelper.setExceptionJson(-1, "中心和云医保平台取消登记成功,但HIS取消失败,", outParam).ToString();
  404. return rtnResult;
  405. }
  406. else
  407. {
  408. //CM 20230602 删除医保平台医保费用明细上传表数据
  409. mIS.deleteFee(out errMsg);
  410. rtnResult = JsonHelper.setIrisReturnValue(0, "取消医保登记成功", null).ToString();
  411. return rtnResult;
  412. }
  413. }
  414. case "Z6"://出院登记
  415. {
  416. break;
  417. }
  418. case "Z6C"://出院登记取消
  419. {
  420. if (cBus.cancleRegister("2405", out errMsg) != 0)
  421. {
  422. rtnResult = JsonHelper.setExceptionJson(-1, "取消出院登记", errMsg).ToString();
  423. return rtnResult;
  424. }
  425. else
  426. {
  427. rtnResult = JsonHelper.setIrisReturnValue(0, "取消出院登记成功", null).ToString();
  428. return rtnResult;
  429. }
  430. break;
  431. }
  432. default:
  433. {
  434. rtnResult = JsonHelper.setExceptionJson(-1, "Register 交易", "传入的业务编码不对!").ToString();
  435. return rtnResult;
  436. }
  437. }
  438. }
  439. catch (Exception ex)
  440. {
  441. rtnResult = JsonHelper.setIrisReturnValue(-1, "Register 发生异常;" + ex.Message, null).ToString();
  442. return rtnResult;
  443. }
  444. finally
  445. {
  446. Global.writeLog("Register 出参:" + JsonHelper.Compress(rtnResult));
  447. }
  448. return "";
  449. }
  450. /// <summary>
  451. /// 费用上传
  452. /// </summary>
  453. /// <param name="InParam"></param>
  454. /// <returns></returns>
  455. public string FeeUpload(string InParam)
  456. {
  457. Global.writeLog("FeeUpload 入参:" + JsonHelper.Compress(InParam));
  458. //设置返回值,错误信息
  459. int errCode;
  460. string errMsg, rtnResult = "", outParam;
  461. try
  462. {
  463. //解析入参
  464. if (parseInparam(InParam, out errMsg) != 0)
  465. {
  466. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  467. return rtnResult;
  468. }
  469. //BS架构调用方式问题,每次调用都需要重新初始化
  470. if (init(InParam, out outParam) != 0)
  471. {
  472. rtnResult = outParam;
  473. return rtnResult;
  474. }
  475. //获取pat
  476. hBus.GetFeeHisInfo(businessType, joInParam, out Global.pat);
  477. switch (businessType)
  478. {
  479. case "M3"://门诊费用上传
  480. {
  481. break;
  482. }
  483. case "M3C"://门诊费用撤销
  484. {
  485. break;
  486. }
  487. case "Z3"://入院费用上传
  488. {
  489. //从医保平台获取患者详细的医保登记信息
  490. if (mIS.queryRegisterInfo(1, out outParam) != 0)
  491. {
  492. rtnResult = JsonHelper.setExceptionJson(-1, "查询患者云平台登记信息", outParam).ToString();
  493. return rtnResult;
  494. }
  495. JObject joReg = JObject.Parse(outParam);
  496. Global.pat.medType = JsonHelper.getDestValue(joReg, "data.MedicalType");
  497. Global.pat.insuType = JsonHelper.getDestValue(joReg, "data.InsuType");
  498. //先取消中心费用传送
  499. cBus.cancleFeeUpload("2302", out errMsg);
  500. //再删除医保传送表的数据
  501. mIS.deleteFee(out errMsg);
  502. #region【住院费用上传前调用3101事前服务】
  503. ////事前分析
  504. if (Global.curEvt.ext.isOpenAnalysis)
  505. {
  506. if (hBus.PreAnalysis("4", "", out errMsg) != 0)
  507. {
  508. rtnResult = JsonHelper.setExceptionJson(-1, "事前分析", errMsg).ToString();
  509. return rtnResult;
  510. }
  511. }
  512. #endregion
  513. //开始进行费用传送
  514. //调用HIS费用查询信息
  515. if (hIS.getHisFee(Global.pat, out outParam) != 0)
  516. {
  517. rtnResult = JsonHelper.setExceptionJson(-1, "获取HIS费用", outParam).ToString();
  518. return rtnResult;
  519. }
  520. //调用医保平台转换
  521. JObject joHisFee = JObject.Parse(outParam);
  522. if (mIS.convertHisFeeWithInsuCode(joHisFee,out outParam) != 0)
  523. {
  524. rtnResult = JsonHelper.setExceptionJson(-1, "转换HIS费用", outParam).ToString();
  525. return rtnResult;
  526. }
  527. JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
  528. //按指定条数分割后上传,保存,更新
  529. if (hBus.uploadFeeToCenter("2301",10, jaFeeDetail, out outParam) != 0)
  530. {
  531. rtnResult = JsonHelper.setExceptionJson(-1, "上传费用", outParam).ToString();
  532. return rtnResult;
  533. }
  534. else
  535. {
  536. rtnResult = JsonHelper.setIrisReturnValue(0, "住院费用上传成功", null).ToString();
  537. return rtnResult;
  538. }
  539. }
  540. case "Z3C"://住院费用上传取消
  541. {
  542. if (cBus.cancleFeeUpload("2302", out errMsg) != 0)
  543. {
  544. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心费用", errMsg).ToString();
  545. return rtnResult;
  546. }
  547. if (mIS.deleteFee( out errMsg) != 0)
  548. {
  549. rtnResult = JsonHelper.setExceptionJson(-1, "删除医保平台费用", errMsg).ToString();
  550. return rtnResult;
  551. }
  552. else
  553. {
  554. rtnResult = JsonHelper.setIrisReturnValue(0, "住院费用上传取消成功", null).ToString();
  555. return rtnResult;
  556. }
  557. }
  558. default:
  559. {
  560. rtnResult = JsonHelper.setExceptionJson(-1, "FeeUpload 交易", "传入的业务编码不对!").ToString();
  561. return rtnResult;
  562. }
  563. }
  564. return rtnResult;
  565. }
  566. catch (Exception ex)
  567. {
  568. rtnResult = JsonHelper.setExceptionJson(-1, "FeeUpload 交易", ex.Message).ToString();
  569. return rtnResult;
  570. }
  571. finally
  572. {
  573. Global.writeLog("FeeUpload 出参:" + JsonHelper.Compress(rtnResult));
  574. }
  575. }
  576. public JObject OutpatientReg(JObject joReg,string patInfo)
  577. {
  578. //医保挂号
  579. JObject jo2201Inpar = JObject.Parse(JsonHelper.getDestProperty(joReg, "data"));
  580. jo2201Inpar = JObject.Parse(JsonHelper.setCenterInpar("2201", jo2201Inpar));
  581. JObject jo2201Rtn = invoker.invokeCenterService("2201", jo2201Inpar);
  582. string errMsg = "";
  583. if (JsonHelper.parseCenterRtnValue(jo2201Rtn, out errMsg) != 0)
  584. {
  585. return JsonHelper.setExceptionJson(-1, "医保挂号", errMsg);
  586. }
  587. else
  588. {
  589. Global.pat.mdtrtID = JsonHelper.getDestValue(jo2201Rtn, "output.data.mdtrt_id");
  590. string outParam = "";
  591. //插入患者本次就诊用的参保信息
  592. if (hBus.insertPatCurInsuInfo(patInfo, out outParam) != 0)
  593. {
  594. if (DialogResult.Yes != MessageBox.Show(outParam, " 是否继续? ", MessageBoxButtons.YesNo))
  595. {
  596. return JsonHelper.setExceptionJson(-1, "插入患者本次就诊用的参保信息,请联系管理员!是否继续?", outParam);
  597. }
  598. }
  599. }
  600. return jo2201Rtn;
  601. }
  602. private string showPatientInfo(out string patInfo,out string outParam)
  603. {
  604. patInfo = "";
  605. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  606. if (hBus.readCard(out outParam) != 0)
  607. {
  608. return JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
  609. }
  610. else
  611. {
  612. patInfo = outParam;
  613. //展示患者信息界面
  614. if (hBus.showPatInfo(patInfo, out outParam) != 0)
  615. {
  616. return JsonHelper.setExceptionJson(-100, "操作员取消!", outParam).ToString();
  617. }
  618. }
  619. #region 展示患者信息
  620. //患者信息赋值给全局变量
  621. patInfo = outParam;
  622. string errMsg = "";
  623. if (hBus.setGlobalPatAfaterShowPatInfo(patInfo, out errMsg) != 0)
  624. {
  625. return JsonHelper.setExceptionJson(-1, "setGlobalPatAfaterShowPatInfo", errMsg).ToString();
  626. }
  627. //校验HIS姓名与医保姓名是否一致
  628. if (hBus.checkName(Global.pat.name, out errMsg) != 0)
  629. {
  630. return JsonHelper.setExceptionJson(-1, "校验HIS与医保姓名是否一致", errMsg).ToString();
  631. }
  632. //先登记
  633. if (hBus.showOutPatRegisterForm(out outParam) != 0)
  634. {
  635. return JsonHelper.setExceptionJson(-1, "显示登记面板", outParam).ToString();
  636. }
  637. #endregion
  638. return "0";
  639. }
  640. /// <summary>
  641. /// 结算
  642. /// </summary>
  643. /// <param name="InParam"></param>
  644. /// <returns></returns>
  645. public string Settlement(string InParam)
  646. {
  647. Global.writeLog("Settlement 入参:" + JsonHelper.Compress(InParam));
  648. //设置返回值,错误信息
  649. string errMsg, rtnResult = "", outParam;
  650. try
  651. {
  652. //解析入参
  653. if (parseInparam(InParam, out errMsg) != 0)
  654. {
  655. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  656. return rtnResult;
  657. }
  658. //BS架构调用方式问题,每次调用都需要重新初始化
  659. if (init(InParam, out outParam) != 0)
  660. {
  661. rtnResult = outParam;
  662. return rtnResult;
  663. }
  664. //获取pat
  665. hBus.GetSettlementHisInfo(businessType, joInParam, out Global.pat);
  666. switch (businessType)
  667. {
  668. case "M4"://门诊预结算
  669. {
  670. // 没有做任何处理?是否必须???
  671. //OutpatientRegistration frmReg = new OutpatientRegistration();
  672. //if (frmReg.ShowDialog() == DialogResult.OK)
  673. //{
  674. // rtnResult = "调用结束";
  675. //}
  676. break;
  677. }
  678. case "M4C"://门诊预结算撤销
  679. {
  680. break;
  681. }
  682. case "M5"://门诊结算
  683. {
  684. #region 读卡
  685. string patInfo = "";
  686. errMsg = showPatientInfo(out patInfo,out outParam);
  687. if (!errMsg.Equals("0"))
  688. {
  689. return errMsg;
  690. }
  691. #endregion
  692. #region 门诊挂号[2201]
  693. JObject joReg = JObject.Parse(outParam);
  694. JObject jo2201Inpar_plain = JObject.Parse(JsonHelper.getDestProperty(joReg, "data"));
  695. jo2201Inpar_plain = JObject.Parse(JsonHelper.setCenterInpar("2201", jo2201Inpar_plain));
  696. JObject jo2201Rtn = OutpatientReg(joReg, patInfo);
  697. //此处先取到就诊信息上传的入参,只要挂号成功就保存到云HIS后台(保存后台需要用到2203入参)
  698. JObject jo2203Inpar = new JObject();
  699. JObject jo2203Inpar_plain = new JObject();
  700. jo2203Inpar.Add("mdtrtinfo", JObject.Parse(JsonHelper.getDestValue(joReg, "mdtrtinfo")));
  701. jo2203Inpar.Add("diseinfo", JArray.Parse(JsonHelper.getDestValue(joReg, "diseinfo")));
  702. jo2203Inpar["mdtrtinfo"]["mdtrt_id"] = Global.pat.mdtrtID;
  703. jo2203Inpar_plain = JObject.Parse(JsonHelper.setCenterInpar_plain("2203A", jo2203Inpar));
  704. jo2203Inpar = JObject.Parse(JsonHelper.setCenterInpar("2203A", jo2203Inpar));
  705. //门诊登记信息,插入云医保平台
  706. jo2201Rtn.Add("validflag", 1);
  707. jo2201Rtn.Add("regstate", 1);
  708. jo2201Rtn.Add("type", 3);
  709. if (mIS.saveOutpatRegisterInfo(jo2201Inpar_plain, jo2201Rtn, jo2203Inpar_plain, out errMsg) != 0)
  710. {
  711. return JsonHelper.setExceptionJson(-1, "中心登记成功但医保平台保存失败,请联系管理员!", errMsg).ToString();
  712. }
  713. #endregion
  714. #region 就诊信息上传[2203]/[2203A]
  715. //门诊就诊信息上传
  716. JObject jo2203Rtn = invoker.invokeCenterService("2203A", jo2203Inpar );
  717. if (JsonHelper.parseCenterRtnValue(jo2203Rtn, out errMsg) != 0)
  718. {
  719. rtnResult = JsonHelper.setExceptionJson(-1, "门诊就诊信息上传", errMsg).ToString();
  720. return rtnResult;
  721. }
  722. #endregion
  723. #region【门诊就诊信息上传成功后调用3101事前服务】
  724. ////事前分析
  725. if (Global.curEvt.ext.isOpenAnalysis)
  726. {
  727. if (hBus.PreAnalysis("2", "", out errMsg) != 0)
  728. {
  729. rtnResult = JsonHelper.setExceptionJson(-1, "事前分析", errMsg).ToString();
  730. return rtnResult;
  731. }
  732. }
  733. #endregion
  734. #region 费用上传[2204]
  735. if (hBus.uploadFee("2204", 50, out outParam) != 0)
  736. {
  737. rtnResult = JsonHelper.setExceptionJson(-1, "费用上传", outParam).ToString();
  738. return rtnResult;
  739. }
  740. #endregion
  741. #region【门诊预结算2206前调用3102医保明细审核事中服务】
  742. //1.获取3102入参报文
  743. ////事前分析
  744. if ((Global.curEvt.ext.isOpenAnalysis) && (Global.operationType == OperationType.SettlementOP))
  745. {
  746. if (hBus.InProcessAnalysis( out errMsg) != 0)
  747. {
  748. rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
  749. return rtnResult;
  750. }
  751. }
  752. #endregion
  753. #region 门诊预结算[2206]
  754. //调用IRIS获取医保各项金额
  755. if (mIS.getSumFee(out outParam) != 0)
  756. {
  757. rtnResult = JsonHelper.setExceptionJson(-1, "获取医保费用各项汇总金额", outParam).ToString();
  758. return rtnResult;
  759. }
  760. JObject joSumFee = JObject.Parse(outParam);
  761. JObject joSettlement = JObject.Parse(JsonHelper.getDestValue(joReg, "settlement"));
  762. //修改joSettlement的就诊ID ,总金额等
  763. joSettlement["mdtrt_id"] = Global.pat.mdtrtID;
  764. joSettlement["medfee_sumamt"] = JsonHelper.getDestValue(joSumFee, "data.Sumamt");
  765. //if ("RegisterOP".Equals(operationType))
  766. //{
  767. // // 门诊挂号(医疗类别)
  768. // joSettlement["med_type"] = "12";
  769. //}
  770. //预结算2206
  771. if (hBus.preSettlement_OutPat(joSettlement, out outParam) != 0)
  772. {
  773. rtnResult = JsonHelper.setExceptionJson(-1, "结算信息展示", outParam).ToString();
  774. return rtnResult;
  775. }
  776. #endregion
  777. #region【门诊正式结算前调用1192身份验证】重庆无?
  778. //if (hBus.IdentityVerify("2207", out errMsg) != 0)
  779. //{
  780. // rtnResult = JsonHelper.setExceptionJson(-1, "调用门诊正式结算2207前,身份核验1192失败", errMsg).ToString();
  781. // return rtnResult;
  782. //}
  783. //else
  784. //{
  785. // JObject joDataExp = new JObject();
  786. // joDataExp.Add("cardtoken", Global.pat.card.Cardtoken);
  787. // joDataExp.Add("acct_payamt", Global.Set.acctPay);
  788. // joDataExp.Add("elec_bill_code", "");
  789. // joDataExp.Add("elec_billno_code", "");
  790. // joDataExp.Add("elec_bill_chkcode", "");
  791. // joSettlement["exp_content"] = joDataExp;
  792. //}
  793. #endregion
  794. # region 正式结算[2207]
  795. JObject joData = new JObject();
  796. joData.Add("data",joSettlement);
  797. JObject joRtn = invoker.invokeCenterService("2207", JsonHelper.setCenterInpar("2207", joData));
  798. if (JsonHelper.parseCenterRtnValue(joRtn, out errMsg) != 0)
  799. {
  800. rtnResult = JsonHelper.setExceptionJson(-1, "结算失败", errMsg).ToString();
  801. return rtnResult;
  802. }
  803. else
  804. {
  805. Global.pat.admType = 1;
  806. Global.pat.ExpContent = ""; //门诊不需要保存 外伤标志等相关扩展参数
  807. //返回给云医保平台结算信息
  808. if (mIS.saveSettlement(joRtn, out errMsg) != 0)
  809. {
  810. rtnResult = JsonHelper.setExceptionJson(-1, "结算成功,但云医保平台保存失败", errMsg).ToString();
  811. return rtnResult;
  812. }
  813. //返回给云医保平台结算明细信息
  814. if (mIS.saveSettlementDetail(joRtn, out errMsg) != 0)
  815. {
  816. rtnResult = JsonHelper.setExceptionJson(-1, "云医保平台保存结算明细失败", errMsg).ToString();
  817. return rtnResult;
  818. }
  819. //返回给HIS
  820. JObject joSetlinfo = JObject.Parse(JsonHelper.getDestValue(joRtn, "output.setlinfo"));
  821. if (hIS.returnOutpatSettlementInfo(joSettlement, joSetlinfo, out outParam) != 0)
  822. {
  823. rtnResult = JsonHelper.setExceptionJson(-1, "返回结算信息给HIS", outParam).ToString();
  824. return rtnResult;
  825. }
  826. else
  827. {
  828. JObject joHisServieRtn = JObject.Parse(outParam);
  829. hBus.returnToFrontEndAfterSettlement(joRtn, joHisServieRtn, out outParam);
  830. rtnResult = JsonHelper.setIrisReturnValue(0, "结算成功", JObject.Parse(outParam)).ToString();
  831. return rtnResult;
  832. }
  833. }
  834. #endregion
  835. }
  836. case "M5C"://门诊结算撤销
  837. {
  838. #region 查询结算信息
  839. //查询HIS医保结算记录表获取该病人的参保地
  840. string sqlStr = "SELECT * FROM BS_MedInsuSettlement WHERE billType = 1 and ValidFlag = 1 ";
  841. sqlStr = sqlStr + " AND Hospital_Dr=" + Global.inf.hospitalDr + " AND Interface_Dr=" + Global.inf.interfaceDr;
  842. sqlStr = sqlStr + " AND SettlementID ='" + Global.pat.settlID + "'";
  843. JObject joSql = new JObject();
  844. joSql.Add("sqlStr", sqlStr);
  845. JObject joSettlInfo = mIS.QuerySettlementInfo(joSql);
  846. //if (JsonHelper.parseIrisRtnValue(joSettlInfo, out errMsg) != 0)
  847. //{
  848. // rtnResult = JsonHelper.setExceptionJson(-1, "查询结算信息失败!", errMsg).ToString();
  849. // return rtnResult;
  850. //}
  851. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joSettlInfo, "result.data[0].insuplc_admdvs");
  852. #endregion
  853. #region 门诊结算撤销 [2208]
  854. string newSettleID = "";
  855. if (cBus.cancleSettlement("2208", out outParam) != 0)
  856. {
  857. int i = outParam.IndexOf("获取到的就诊信息为无效状态,不能办理结算撤销业务");
  858. if (i != 0)
  859. {
  860. if (DialogResult.Yes != MessageBox.Show("医保中心提示:" + outParam + ",是否强制撤销HIS结算信息?", "提示", MessageBoxButtons.YesNo))
  861. {
  862. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消结算失败,", outParam).ToString();
  863. return rtnResult;
  864. }
  865. newSettleID = "YC";
  866. }
  867. else
  868. {
  869. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心结算", outParam).ToString();
  870. //查看是医保平台是否已经退费,如果是,则询问是否继续退费
  871. string SqlStr = " SELECT * FROM BS_MedInsuSettlement WHERE ValidFlag = 0 AND BillType = -1 ";
  872. SqlStr = SqlStr + " AND Hospital_Dr=" + Global.inf.hospitalDr + " AND Interface_Dr=" + Global.inf.interfaceDr;
  873. SqlStr = SqlStr + " AND SettlementID ='" + Global.pat.settlID + "'";
  874. JObject joSqlStr = new JObject();
  875. joSqlStr.Add("sqlStr", SqlStr);
  876. JObject joCancleSettlInfo = mIS.QuerySettlementInfo(joSqlStr);
  877. JArray jaCancleSettlInfo = JArray.Parse(JsonHelper.getDestValue(joCancleSettlInfo, "result.data"));
  878. if (jaCancleSettlInfo.Count == 1)
  879. {
  880. //询问收款员是否继续进行HIS退费
  881. if (DialogResult.Yes == MessageBox.Show("中心提示:" + outParam, " 该费用在医保中心已成功退费但在HIS未成功退费,是否强制退HIS费用? ", MessageBoxButtons.YesNo))
  882. {
  883. rtnResult = JsonHelper.setExceptionJson(0, "该费用在医保中心已成功退费但在HIS未成功退费,收款员选择强制退HIS费用!", outParam).ToString();
  884. }
  885. }
  886. else
  887. {
  888. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心结算(云医保平台未退费或未查询到退费记录)", outParam).ToString();
  889. }
  890. return rtnResult;
  891. }
  892. }
  893. else
  894. {
  895. newSettleID = JsonHelper.getDestValue(JObject.Parse(outParam), "output.setlinfo.setl_id");
  896. }
  897. //退云医保平台结算
  898. if (mIS.cancleSettlement(newSettleID, out outParam) != 0)
  899. {
  900. rtnResult = JsonHelper.setExceptionJson(-1, "取消平台结算信息", outParam).ToString();
  901. //return rtnResult;
  902. }
  903. #endregion
  904. #region 费用明细取消[2205]
  905. //中心取消传送
  906. if (cBus.cancleFeeUpload("2205", out errMsg) != 0)
  907. {
  908. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心费用", errMsg).ToString();
  909. return rtnResult;
  910. }
  911. //云平台取消传送
  912. if (mIS.deleteFee(out errMsg) != 0)
  913. {
  914. rtnResult = JsonHelper.setExceptionJson(-1, "删除医保平台费用", errMsg).ToString();
  915. return rtnResult;
  916. }
  917. #endregion
  918. #region 取消挂号[2202]
  919. //取消中心登记
  920. if (cBus.cancleRegister("2202", out outParam) != 0)
  921. {
  922. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记失败,", outParam).ToString();
  923. return rtnResult;
  924. }
  925. //取消医保平台登记
  926. if (mIS.cancleRegister(3, out outParam) != 0)
  927. {
  928. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记成功,但云医保平台取消失败,", outParam).ToString();
  929. return rtnResult;
  930. }
  931. #endregion
  932. #region 退HIS结算
  933. if (hIS.cancleSettlementInfo(joParam, out outParam) != 0)
  934. {
  935. rtnResult = JsonHelper.setExceptionJson(-1, "取消HIS结算信息", outParam).ToString();
  936. return rtnResult;
  937. }
  938. else
  939. {
  940. rtnResult = JsonHelper.setIrisReturnValue(0, "取消结算成功", null).ToString();
  941. return rtnResult;
  942. }
  943. #endregion
  944. }
  945. case "M6"://门诊移动支付结算
  946. {
  947. MobilePay mp = new MobilePay(InParam, out errMsg);
  948. if (errMsg != "")
  949. {
  950. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  951. return rtnResult;
  952. }
  953. if (mp.MobilePaySettlement(out outParam) != 0)
  954. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", outParam).ToString();
  955. else
  956. rtnResult = outParam;
  957. return rtnResult;
  958. }
  959. case "M6C"://门诊移动支付结算撤销
  960. {
  961. string onlineYBFalg = JsonHelper.getDestValue(joInsuAdmObj, "onlineYBFalg");
  962. MobilePay mp = new MobilePay(InParam, out errMsg);
  963. if (errMsg != "")
  964. {
  965. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  966. return rtnResult;
  967. }
  968. if (String.IsNullOrEmpty(onlineYBFalg))
  969. {
  970. mp.MSettl.onlineYBFalg = "N";
  971. }
  972. else
  973. {
  974. mp.MSettl.onlineYBFalg = onlineYBFalg;
  975. }
  976. if (mp.MobilePayCancelSettlement(out outParam) != 0)
  977. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", outParam).ToString();
  978. else
  979. rtnResult = outParam;
  980. return rtnResult;
  981. }
  982. case "M6Confirm"://门诊移动支付确认
  983. {
  984. MobilePay mp = new MobilePay(InParam, out errMsg);
  985. if (errMsg != "")
  986. {
  987. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", errMsg).ToString();
  988. return rtnResult;
  989. }
  990. if (mp.MobilePayConfirmSettlement(out outParam) != 0)
  991. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", outParam).ToString();
  992. else
  993. rtnResult = outParam;
  994. return rtnResult;
  995. }
  996. case "Z4"://住院预结算
  997. {
  998. #region 预结算(需先进行调用费用明细上传)
  999. Global.pat.RYorCY = "2";
  1000. JObject joSettle = new JObject();
  1001. if (hBus.preSettlement("2303",out joSettle, out outParam) != 0)
  1002. {
  1003. rtnResult = JsonHelper.setExceptionJson(-1, "结算信息展示", outParam).ToString();
  1004. return rtnResult;
  1005. }
  1006. else
  1007. {
  1008. rtnResult = JsonHelper.setIrisReturnValue(0, "预结算成功", null).ToString();
  1009. return rtnResult;
  1010. }
  1011. #endregion
  1012. }
  1013. case "Z4C"://住院预结算撤销
  1014. {
  1015. rtnResult = JsonHelper.setExceptionJson(-100, "该接口不支持预结算取消!", null).ToString();
  1016. return rtnResult;
  1017. }
  1018. case "Z5"://住院结算
  1019. {
  1020. #region【住院预结算2303前调用3102医保明细审核事中服务】
  1021. //1.获取3102入参报文
  1022. /*
  1023. */
  1024. #endregion
  1025. Global.pat.admType = 2;
  1026. Global.pat.RYorCY = "2";
  1027. #region【住院预结算前调用1192身份验证】
  1028. //if (hBus.IdentityVerify("2304", out errMsg) != 0)
  1029. //{
  1030. // rtnResult = JsonHelper.setExceptionJson(-1, "调用住院正式结算2304前,身份核验1192失败", errMsg).ToString();
  1031. // return rtnResult;
  1032. //}
  1033. #endregion
  1034. JObject joPreSetOutpar ;
  1035. // 结算前先调用预结算?
  1036. if (hBus.preSettlement("2303",out joPreSetOutpar, out outParam) != 0)
  1037. {
  1038. rtnResult = JsonHelper.setExceptionJson(-1, "结算信息展示", outParam).ToString();
  1039. return rtnResult;
  1040. }
  1041. else
  1042. {
  1043. #region【住院正式结算前调用1192身份验证】
  1044. //if (hBus.IdentityVerify("2304", out errMsg) != 0)
  1045. //{
  1046. // rtnResult = JsonHelper.setExceptionJson(-1, "调用住院正式结算2304前,身份核验1192失败", errMsg).ToString();
  1047. // return rtnResult;
  1048. //}
  1049. //else
  1050. //{
  1051. // JObject joDataExp = new JObject();
  1052. // joDataExp.Add("cardtoken", Global.pat.card.Cardtoken);
  1053. // joDataExp.Add("acct_payamt", Global.Set.acctPay);
  1054. // joDataExp.Add("elec_bill_code", "");
  1055. // joDataExp.Add("elec_billno_code", "");
  1056. // joDataExp.Add("elec_bill_chkcode", "");
  1057. // joSettlement["exp_content"] = joDataExp;
  1058. //}
  1059. #endregion
  1060. #region 正式出院结算
  1061. JObject joSettlement = joSettlement = JObject.Parse(JsonHelper.getDestValue(joPreSetOutpar, "Settlement"));
  1062. JObject joDataExp = new JObject();
  1063. joDataExp.Add("cardtoken", Global.pat.card.Cardtoken);
  1064. joDataExp.Add("acct_payamt", Global.Set.acctPay);
  1065. joDataExp.Add("elec_bill_code", "");
  1066. joDataExp.Add("elec_billno_code", "");
  1067. joDataExp.Add("elec_bill_chkcode", "");
  1068. joSettlement["exp_content"] = joDataExp;
  1069. joSettlement.Add("data", joSettlement);
  1070. JObject jo2304Rtn = invoker.invokeCenterService("2304",JsonHelper.setCenterInpar("2304",joSettlement));
  1071. if (JsonHelper.parseCenterRtnValue(jo2304Rtn, out errMsg) != 0)
  1072. {
  1073. rtnResult = JsonHelper.setExceptionJson(-1, "结算失败", errMsg).ToString();
  1074. cBus.cancleRegister("2405", out errMsg);
  1075. return rtnResult;
  1076. }
  1077. else
  1078. {
  1079. Global.pat.admType = 2;
  1080. //返回给云医保平台结算信息
  1081. if (mIS.saveSettlement(jo2304Rtn, out errMsg) != 0)
  1082. {
  1083. rtnResult = JsonHelper.setExceptionJson(-1, "结算成功,但云医保平台保存失败", errMsg).ToString();
  1084. return rtnResult;
  1085. }
  1086. //返回给云医保平台结算明细信息
  1087. if (mIS.saveSettlementDetail(jo2304Rtn, out errMsg) != 0)
  1088. {
  1089. rtnResult = JsonHelper.setExceptionJson(-1, "云医保平台保存结算明细失败", errMsg).ToString();
  1090. Global.writeLog(rtnResult);
  1091. MessageBox.Show(errMsg);
  1092. }
  1093. //返回给HIS
  1094. JObject joSetlinfo = JObject.Parse(JsonHelper.getDestValue(jo2304Rtn, "output.setlinfo"));
  1095. if (hIS.returnInpatSettlementInfo(joParam, joSetlinfo, out outParam) != 0)
  1096. {
  1097. rtnResult = JsonHelper.setExceptionJson(-1, "返回结算信息给HIS", outParam).ToString();
  1098. return rtnResult;
  1099. }
  1100. else
  1101. {
  1102. //返回给前端
  1103. JObject joHisServieRtn = JObject.Parse(outParam);
  1104. hBus.returnToFrontEndAfterSettlement(jo2304Rtn, joHisServieRtn, out outParam);
  1105. rtnResult = JsonHelper.setIrisReturnValue(0, "结算成功", JObject.Parse(outParam)).ToString();
  1106. return rtnResult;
  1107. }
  1108. }
  1109. #endregion
  1110. }
  1111. }
  1112. case "Z5C"://住院结算撤销
  1113. {
  1114. //查询结算表
  1115. string sqlStr = "SELECT * FROM BS_MedInsuSettlement WHERE billType = 1 and Hospital_Dr=" + Global.inf.hospitalDr
  1116. + " and Adm_Dr='" + Global.pat.adm_Dr + "'"
  1117. + " and MdtrtID='" + Global.pat.mdtrtID + "'"
  1118. + " Order By ID DESC ";
  1119. JObject joSql = new JObject();
  1120. joSql.Add("sqlStr", sqlStr);
  1121. JObject joSettlInfo = mIS.QuerySettlementInfo(joSql);
  1122. //if (JsonHelper.parseIrisRtnValue(joSettlInfo, out errMsg) != 0)
  1123. //{
  1124. // rtnResult = JsonHelper.setExceptionJson(-1, "查询结算信息失败!", errMsg).ToString();
  1125. // return rtnResult;
  1126. //}
  1127. //MessageBox.Show(joSettlInfo.ToString());
  1128. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joSettlInfo, "result.data[0].insuplc_admdvs");
  1129. Global.pat.SettID_YBJSB = JsonHelper.getDestValue(joSettlInfo, "result.data[0].SettlementID");
  1130. if (Global.pat.settlID != Global.pat.SettID_YBJSB)
  1131. {
  1132. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", "通过09010059服务获取到的SettlementID<" + Global.pat.settlID + ">与DLL通过SQL语句" +
  1133. joSql + ",获取到的SettlementID<" + Global.pat.SettID_YBJSB + ">不同,可能存在HIS单边账,请联系医保开发人员处理该笔结算记录!").ToString();
  1134. //return rtnResult;
  1135. }
  1136. Global.pat.settlID = Global.pat.SettID_YBJSB;
  1137. //取消中心结算信息
  1138. if (cBus.cancleSettlement("2305", out outParam) != 0)
  1139. {
  1140. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心结算信息失败!", outParam).ToString();
  1141. //查看是医保平台是否已经退费,如果是,则询问是否继续退费
  1142. string SqlStr = " SELECT * FROM BS_MedInsuSettlement WHERE ValidFlag = 0 AND BillType = -1 ";
  1143. SqlStr = SqlStr + " AND Hospital_Dr=" + Global.inf.hospitalDr + " AND Interface_Dr=" + Global.inf.interfaceDr;
  1144. SqlStr = SqlStr + " AND SettlementID ='" + Global.pat.settlID + "'";
  1145. JObject joSqlStr = new JObject();
  1146. joSqlStr.Add("sqlStr", SqlStr);
  1147. JObject joCancleSettlInfo = mIS.QuerySettlementInfo(joSqlStr);
  1148. JArray jaCancleSettlInfo = JArray.Parse(JsonHelper.getDestValue(joCancleSettlInfo, "result.data"));
  1149. if (jaCancleSettlInfo.Count == 1)
  1150. {
  1151. //询问收款员是否继续进行HIS退费
  1152. if (DialogResult.Yes == MessageBox.Show("中心提示:" + outParam, " 该费用在医保中心已成功退费但在HIS未成功退费,是否强制退HIS费用? ", MessageBoxButtons.YesNo))
  1153. {
  1154. rtnResult = JsonHelper.setExceptionJson(0, "该费用在医保中心已成功退费但在HIS未成功退费,收款员选择强制退HIS费用!", outParam).ToString();
  1155. }
  1156. }
  1157. else
  1158. {
  1159. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心结算(云医保平台未退费或未查询到退费记录)", outParam).ToString();
  1160. }
  1161. return rtnResult;
  1162. }
  1163. else
  1164. {
  1165. //退结算会返一个新的ID
  1166. string newSettleID = JsonHelper.getDestValue(JObject.Parse(outParam), "output.setlinfo.setl_id");
  1167. //取消平台结算信息
  1168. if (mIS.cancleSettlement(newSettleID, out outParam) != 0)
  1169. {
  1170. rtnResult = JsonHelper.setExceptionJson(-1, "中心结算取消成功,医保平台结算信息取消失败!", outParam).ToString();
  1171. return rtnResult;
  1172. }
  1173. //取消出院登记
  1174. if (cBus.cancleRegister("2405", out outParam) != 0)
  1175. {
  1176. rtnResult = JsonHelper.setExceptionJson(0, "中心,医保平台及HIS结算信息取消成功,取消出院登记失败!请手工取消出院登记!", outParam).ToString();
  1177. return rtnResult;
  1178. }
  1179. //中心取消传送
  1180. if (cBus.cancleFeeUpload("2302", out errMsg) != 0)
  1181. {
  1182. //rtnResult = JsonHelper.setExceptionJson(-1, "取消中心费用", errMsg).ToString();
  1183. //return rtnResult;
  1184. }
  1185. //云平台取消传送
  1186. if (mIS.deleteFee(out errMsg) != 0)
  1187. {
  1188. //rtnResult = JsonHelper.setExceptionJson(-1, "删除医保平台费用", errMsg).ToString();
  1189. //return rtnResult;
  1190. }
  1191. //取消HIS医保结算信息
  1192. if (hIS.cancleSettlementInfo(joParam, out outParam) != 0)
  1193. {
  1194. rtnResult = JsonHelper.setExceptionJson(-1, "中心跟医保平台结算取消成功, 取消HIS结算信息失败!", outParam).ToString();
  1195. return rtnResult;
  1196. }
  1197. rtnResult = JsonHelper.setIrisReturnValue(0, "取消结算成功", null).ToString();
  1198. return rtnResult;
  1199. }
  1200. }
  1201. default:
  1202. {
  1203. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", "传入的业务编码不对!").ToString();
  1204. return rtnResult;
  1205. }
  1206. }
  1207. return rtnResult;
  1208. }
  1209. catch (Exception ex)
  1210. {
  1211. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", ex.Message).ToString();
  1212. return rtnResult;
  1213. }
  1214. finally
  1215. {
  1216. Global.writeLog("Settlement 出参:" + JsonHelper.Compress(rtnResult));
  1217. }
  1218. }
  1219. //[STAThread]
  1220. //public void print(JObject joInParam)
  1221. //{
  1222. // //显示打印界面
  1223. // SettlementChecklist frmSettlList;
  1224. // string insuAdmObj = JsonHelper.getDestValue(joInParam, "insuAdmObj");
  1225. // if (insuAdmObj == "")
  1226. // {
  1227. // frmSettlList = new SettlementChecklist();
  1228. // }
  1229. // else
  1230. // {
  1231. // JObject joInsuAdmObj = JObject.Parse(insuAdmObj);
  1232. // frmSettlList = new SettlementChecklist(joInsuAdmObj);
  1233. // }
  1234. // if (frmSettlList.ShowDialog() == DialogResult.OK)
  1235. // {
  1236. // };
  1237. //}
  1238. //[STAThread]
  1239. /// <summary>
  1240. /// 辅助交易
  1241. /// </summary>
  1242. /// <param name="InParam"></param>
  1243. /// <returns></returns>
  1244. public string AgentFun(string InParam)
  1245. {
  1246. Global.writeLog("AgentFun 入参:" + JsonHelper.Compress(InParam));
  1247. //设置返回值,错误信息
  1248. int errCode;
  1249. string errMsg, rtnResult = "", outParam;
  1250. try
  1251. {
  1252. //解析入参
  1253. if (parseInparam(InParam, out errMsg) != 0)
  1254. {
  1255. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  1256. return rtnResult;
  1257. }
  1258. //BS架构调用方式问题,每次调用都需要重新初始化
  1259. if (init(InParam, out outParam) != 0)
  1260. {
  1261. Global.writeLog("初始化异常:" + outParam);
  1262. rtnResult = outParam;
  1263. // 基础数据没有初始化成功,也可以运行
  1264. if (!businessType.Equals("BasicData"))
  1265. {
  1266. return rtnResult;
  1267. }
  1268. }
  1269. //获取pat
  1270. hBus.GetAgentFunHisInfo(businessType, joInParam, out Global.pat);
  1271. switch (businessType)
  1272. {
  1273. case "BasicData"://基础数据维护
  1274. {
  1275. PTMedicalInsurance.Forms.BasicDatas.BasicData bd = new PTMedicalInsurance.Forms.BasicDatas.BasicData();
  1276. bd.WindowState = FormWindowState.Maximized;
  1277. bd.StartPosition = FormStartPosition.CenterParent;
  1278. bd.ShowDialog();
  1279. break;
  1280. }
  1281. case "Exception"://异常处理
  1282. {
  1283. //显示异常处理界面
  1284. HandleException frmEX = new HandleException();
  1285. if (frmEX.ShowDialog() == DialogResult.OK)
  1286. {
  1287. }
  1288. break;
  1289. }
  1290. case "CheckAndClearing"://对账清算
  1291. {
  1292. STA sta = new STA();
  1293. Thread thread = new Thread(sta.CheckAndClearing);
  1294. thread.SetApartmentState(ApartmentState.STA); //重点
  1295. thread.IsBackground = true;
  1296. thread.Start();
  1297. thread.Join();
  1298. break;
  1299. }
  1300. case "Print"://打印
  1301. {
  1302. try
  1303. {
  1304. //显示打印界面
  1305. SettlementChecklist frmSettlList;
  1306. string insuAdmObj = JsonHelper.getDestValue(joInParam, "insuAdmObj");
  1307. if (insuAdmObj == "")
  1308. {
  1309. frmSettlList = new SettlementChecklist();
  1310. frmSettlList.ShowDialog();
  1311. }
  1312. else
  1313. {
  1314. JObject joInsuAdmObj = JObject.Parse(insuAdmObj);
  1315. frmSettlList = new SettlementChecklist(joInsuAdmObj);
  1316. string groupID = JsonHelper.getDestValue((JObject)Global.curEvt.jaSession[0], "groupID");
  1317. DataTable dt = (DataTable)frmSettlList.dgvSettlRecord.DataSource;
  1318. if (dt.Rows.Count != 1)
  1319. {
  1320. frmSettlList.ShowDialog();
  1321. }
  1322. else
  1323. {
  1324. frmSettlList.btnPrint_Click(null, null);
  1325. }
  1326. }
  1327. return JsonHelper.setIrisReturnValue(0, "", null).ToString();
  1328. }
  1329. catch (Exception ex)
  1330. {
  1331. MessageBox.Show(ex.Message);
  1332. }
  1333. break;
  1334. }
  1335. case "Log"://日志
  1336. {
  1337. MessageBox.Show(businessType);
  1338. break;
  1339. }
  1340. case "RecordUpload"://上传记录
  1341. {
  1342. MessageBox.Show(businessType);
  1343. break;
  1344. }
  1345. case "HospitalRegister"://备案
  1346. {
  1347. ToRecordChoose Referral = new ToRecordChoose();
  1348. Referral.ShowDialog();
  1349. break;
  1350. }
  1351. case "PreAndInProcessAnalysis"://事前分析 诊间只有住院的事前分析
  1352. {
  1353. Global.pat.adm_Dr = JsonHelper.getDestValue(joInParam, "params[0].admID");
  1354. JObject joResult = new JObject();
  1355. joResult.Add("result", JObject.Parse(JsonHelper.getDestValue(joParam, "insuData")));
  1356. //事前分析
  1357. if (Global.curEvt.ext.isOpenAnalysis)
  1358. {
  1359. //中心要求诊间也传4
  1360. if (hBus.PreAnalysis("4", joResult.ToString(), out errMsg) != 0)
  1361. {
  1362. rtnResult = JsonHelper.setExceptionJson(-1, "AgentFun-PreAndInProcessAnalysis 交易!", errMsg).ToString();
  1363. return rtnResult;
  1364. }
  1365. else
  1366. {
  1367. rtnResult = JsonHelper.setExceptionJson(0, "AgentFun-PreAndInProcessAnalysis 交易", "事前提醒执行成功!中心未提示违规!").ToString();
  1368. return rtnResult;
  1369. }
  1370. }
  1371. break;
  1372. }
  1373. case "PrescribeCirculation"://处方流转
  1374. {
  1375. PrescriptionCirculation PresCir = new PrescriptionCirculation();
  1376. PresCir.ShowDialog();
  1377. break;
  1378. }
  1379. default:
  1380. {
  1381. rtnResult = JsonHelper.setExceptionJson(-1, "AgentFun 交易", "传入的业务编码不对!").ToString();
  1382. return rtnResult;
  1383. }
  1384. }
  1385. return rtnResult;
  1386. }
  1387. catch (Exception ex)
  1388. {
  1389. rtnResult = JsonHelper.setExceptionJson(-1, "AgentFun 交易", ex.Message).ToString();
  1390. return rtnResult;
  1391. }
  1392. finally
  1393. {
  1394. Global.writeLog("AgentFun 出参:" + JsonHelper.Compress(rtnResult));
  1395. }
  1396. }
  1397. public string Download(string InParam)
  1398. {
  1399. Global.writeLog("Download 入参:" + JsonHelper.Compress(InParam));
  1400. //设置返回值,错误信息
  1401. int errCode;
  1402. string errMsg, rtnResult = "", outParam;
  1403. try
  1404. {
  1405. //解析入参
  1406. if (parseInparam(InParam, out errMsg) != 0)
  1407. {
  1408. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  1409. return rtnResult;
  1410. }
  1411. //BS架构调用方式问题,每次调用都需要重新初始化
  1412. if (init(InParam, out outParam) != 0)
  1413. {
  1414. rtnResult = outParam;
  1415. return rtnResult;
  1416. }
  1417. dynamic joData = new JObject();
  1418. joData.data = joParam["data"];
  1419. //string code = (string)joInParam["code"];
  1420. string funNO = (string)joParam["funNO"];
  1421. switch (businessType)
  1422. {
  1423. case "DirectoryDownload":
  1424. {
  1425. string downloadParam = JsonHelper.setCenterInpar(funNO, joData.ToString());
  1426. rtnResult = hBus.DownloadDirectory(funNO, downloadParam).ToString();
  1427. break;
  1428. }
  1429. case "DictionayDownload":
  1430. {
  1431. string downloadParam = JsonHelper.setCenterInpar(funNO, joData.ToString());
  1432. rtnResult = hBus.downDictionary(downloadParam);
  1433. break;
  1434. }
  1435. }
  1436. return rtnResult;
  1437. }
  1438. catch (Exception ex)
  1439. {
  1440. rtnResult = JsonHelper.setExceptionJson(-100, "Download", ex.Message).ToString();
  1441. return rtnResult;
  1442. }
  1443. finally
  1444. {
  1445. Global.writeLog("Download 出参:" + rtnResult);
  1446. }
  1447. }
  1448. public string PlatformDirectConnect(string InParam)
  1449. {
  1450. //设置返回值,错误信息
  1451. int errCode;
  1452. string errMsg, rtnResult = "", outParam;
  1453. try
  1454. {
  1455. Global.writeLog("PlatformDirectConnect 入参:" + JsonHelper.Compress(InParam));
  1456. //解析入参
  1457. if (parseInparam(InParam, out errMsg) != 0)
  1458. {
  1459. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  1460. return rtnResult;
  1461. }
  1462. Global.businessType = businessType;
  1463. string funNO = JsonHelper.getDestValue(joInParam, "funNO");
  1464. //BS架构调用方式问题,每次调用都需要重新初始化
  1465. if (init(InParam, out outParam) != 0)
  1466. {
  1467. rtnResult = outParam;
  1468. return rtnResult;
  1469. }
  1470. if (funNO=="4101Y")
  1471. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joInParam, "insuplc_admdvs");
  1472. JObject joRtn = invoker.invokeCenterService(funNO, JsonHelper.setCenterInpar(funNO, joParam));
  1473. if (JsonHelper.parseCenterRtnValue(joRtn, out errMsg) != 0)
  1474. {
  1475. rtnResult = JsonHelper.setExceptionJson(-1, "平台直连错误", errMsg).ToString();
  1476. return rtnResult;
  1477. }
  1478. else
  1479. {
  1480. rtnResult = JsonHelper.setIrisReturnValue(0, "", joRtn).ToString();
  1481. return rtnResult;
  1482. }
  1483. }
  1484. catch (Exception ex)
  1485. {
  1486. rtnResult = JsonHelper.setExceptionJson(-1, "PlatformDirectConnect 交易", ex.Message).ToString();
  1487. return rtnResult;
  1488. }
  1489. finally
  1490. {
  1491. Global.writeLog("PlatformDirectConnect 出参:" + JsonHelper.Compress(rtnResult));
  1492. }
  1493. }
  1494. /// <summary>
  1495. /// 自助机
  1496. /// </summary>
  1497. /// <param name="InParam"></param>
  1498. /// <returns></returns>
  1499. public string SelfServiceMachine(string InParam)
  1500. {
  1501. Global.writeLog("SelfServiceMachine 入参:" + JsonHelper.Compress(InParam));
  1502. //设置返回值,错误信息
  1503. string errMsg, rtnResult = "", outParam;
  1504. try
  1505. {
  1506. //解析入参
  1507. if (parseInparam(InParam, out errMsg) != 0)
  1508. {
  1509. rtnResult = JsonHelper.setExceptionJson(-1, "parseInparam", errMsg).ToString();
  1510. return rtnResult;
  1511. }
  1512. //获取pat
  1513. hBus.GetSelfServiceMachineInfo(businessType, joInParam, out Global.pat);
  1514. //BS架构调用方式问题,每次调用都需要重新初始化
  1515. if (init(InParam, out errMsg) != 0)
  1516. //if (hBus.InitA(InParam, out errMsg) != 0)
  1517. {
  1518. rtnResult = JsonHelper.setExceptionJson(-1, "InitA", errMsg).ToString(); ;
  1519. return rtnResult;
  1520. }
  1521. else
  1522. {
  1523. //joInParam.Add("patInfo", errMsg);
  1524. Global.writeLog($"InitA初始化成功!");
  1525. }
  1526. switch (businessType)
  1527. {
  1528. case "GetPatientInfo"://读取患者信息,该节点无需重定向
  1529. {
  1530. //重定向
  1531. Business.Core.SelfServiceMachine.PatientService patientService = new Business.Core.SelfServiceMachine.PatientService();
  1532. rtnResult = patientService.GetPatientInfo();
  1533. break;
  1534. }
  1535. case "OPReg"://门诊挂号
  1536. {
  1537. #region 链条式任务调度者
  1538. OPRegService service = new OPRegService();
  1539. rtnResult = service.Charge(operationType, joInParam);
  1540. break;
  1541. #endregion
  1542. }
  1543. case "OPSettl"://门诊结算
  1544. {
  1545. OPSettlementService service = new OPSettlementService();
  1546. rtnResult = service.Charge(operationType, joInParam);
  1547. break;
  1548. }
  1549. case "IPInReg"://入院登记
  1550. {
  1551. IPAdmRegService service = new IPAdmRegService();
  1552. rtnResult = service.Register(operationType, joInParam);
  1553. break;
  1554. }
  1555. case "IPInRegCancel"://取消入院登记
  1556. {
  1557. IPAdmRegService service = new IPAdmRegService();
  1558. rtnResult = service.CancelRegister(operationType, joInParam);
  1559. break;
  1560. }
  1561. case "IPOutReg"://出院登记
  1562. {
  1563. break;
  1564. }
  1565. case "IPUpoload"://住院费用上传
  1566. {
  1567. break;
  1568. }
  1569. case "IPPreSettl"://住院预计结算
  1570. {
  1571. break;
  1572. }
  1573. case "IPSettl"://住院结算
  1574. {
  1575. IPSettlementService service = new IPSettlementService();
  1576. rtnResult = service.Charge(joInParam);
  1577. return rtnResult;
  1578. }
  1579. case "DischargeAudit"://费用核查
  1580. {
  1581. DischargeAuditService service = new DischargeAuditService();
  1582. rtnResult = service.Audit(joInParam);
  1583. return rtnResult;
  1584. }
  1585. default:
  1586. {
  1587. rtnResult = JsonHelper.setExceptionJson(-1, "SelfServiceMachine 交易", "传入的业务编码不对!").ToString();
  1588. return rtnResult;
  1589. }
  1590. }
  1591. return rtnResult;
  1592. }
  1593. catch (Exception ex)
  1594. {
  1595. rtnResult = JsonHelper.setExceptionJson(-1, "SelfServiceMachine 交易", ex.Message).ToString();
  1596. return rtnResult;
  1597. }
  1598. finally
  1599. {
  1600. Global.writeLog("SelfServiceMachine 出参:" + JsonHelper.Compress(rtnResult));
  1601. }
  1602. }
  1603. }
  1604. }