InsuBusiness.cs 87 KB

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