InsuBusiness.cs 114 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166
  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. using PTMedicalInsurance.Business.Core.SelfServiceMachine.ProcessScheduler;
  17. using PTMedicalInsurance.Business.Core.Forms.DischargeAudit;
  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. private string businessType;
  40. private string operationType;
  41. public InsuBusiness()
  42. {
  43. Global.curEvt.path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
  44. ComputerInfo comp = new ComputerInfo();
  45. Global.curEvt.mac = comp.GetMAC();
  46. Global.curEvt.ip = comp.GetIP(); //"10.1.4.100";
  47. Global.pat.insuplc_admdvs = ""; //如果是NULL中心会报错
  48. }
  49. private int parseInparam(string inParam,out string errMsg)
  50. {
  51. errMsg = "";
  52. try
  53. {
  54. joInParam = JObject.Parse(inParam);
  55. jaSession = JArray.Parse(JsonHelper.getDestValue(joInParam, "session"));
  56. Global.curEvt.jaSession = jaSession;
  57. jaParams = JArray.Parse(JsonHelper.getDestValue(joInParam, "params"));
  58. joParam = JObject.FromObject(jaParams[0]);
  59. if (JsonHelper.getDestValue(joInParam, "insuAdmObj") != "")
  60. joInsuAdmObj = JObject.Parse(JsonHelper.getDestValue(joInParam, "insuAdmObj"));
  61. joInterface = JObject.Parse(JsonHelper.getDestValue(joInParam, "interfaceinfo"));
  62. businessType = JsonHelper.getDestValue(joInParam, "businessType");
  63. operationType = JsonHelper.getDestValue(joInParam, "operationType");
  64. if ((businessType == "M6") || (businessType == "M6C") || (businessType == "M6Confirm"))
  65. {
  66. Environment.CurrentDirectory = @"D:\HttpServerAPI\bin\libs";
  67. }
  68. return 0;
  69. }
  70. catch (Exception ex)
  71. {
  72. errMsg = "parseInparam 解析入参异常:" + errMsg;
  73. return -1;
  74. }
  75. }
  76. /// <summary>
  77. /// 签到
  78. /// </summary>
  79. /// <param name="InParam"></param>
  80. /// <returns></returns>
  81. public string Init(string InParam)
  82. {
  83. string errMsg, rtnResult ="";
  84. JObject joRtn = new JObject();
  85. try
  86. {
  87. if (hBus.initEnvironment(InParam, out errMsg) != 0)
  88. {
  89. return JsonHelper.setExceptionJson(-100, "initEnvironment 失败", errMsg).ToString();
  90. }
  91. else
  92. {
  93. if (businessType == "DischargeAudit")
  94. {
  95. rtnResult = JsonHelper.setIrisReturnValue(0, "无需签到", joRtn).ToString();
  96. return rtnResult;
  97. }
  98. if (mIS.isSigned(ref Global.curEvt.signno) != true)
  99. {
  100. //签到
  101. if (cBus.signIn(out joRtn) != 0)
  102. {
  103. rtnResult = JsonHelper.setExceptionJson(-1, "签到异常", (string)joRtn["err_msg"]).ToString();
  104. return rtnResult;
  105. }
  106. else
  107. {
  108. Global.curEvt.signno = JsonHelper.getDestValue(joRtn, "output.signinoutb.sign_no");
  109. //插入签到表
  110. if (mIS.saveSignRecord(Global.curEvt.signno, out errMsg) != 0)
  111. {
  112. rtnResult = JsonHelper.setIrisReturnValue(0, "中心签到成功但插入签到表失败:" + errMsg, null).ToString();
  113. }
  114. else
  115. {
  116. rtnResult = JsonHelper.setIrisReturnValue(0, "签到成功", joRtn).ToString();
  117. }
  118. }
  119. }
  120. else
  121. {
  122. rtnResult = JsonHelper.setIrisReturnValue(0, "初始化成功!", null).ToString();
  123. }
  124. return rtnResult;
  125. }
  126. }
  127. catch (Exception ex)
  128. {
  129. rtnResult = JsonHelper.setExceptionJson(-100, "Init 异常", ex.Message).ToString();
  130. return rtnResult;
  131. }
  132. finally
  133. {
  134. Global.writeLog("初始化结果:" + rtnResult);
  135. }
  136. }
  137. /// <summary>
  138. /// 初始化
  139. /// </summary>
  140. /// <param name="inParam"></param>
  141. /// <param name="outParam"></param>
  142. /// <returns></returns>
  143. private int init(string inParam, out string outParam)
  144. {
  145. string errMsg;
  146. outParam = "";
  147. try
  148. {
  149. //BS架构调用方式问题,每次调用都需要重新初始化
  150. JObject joInitRtn = JObject.Parse(Init(inParam));
  151. if (JsonHelper.parseIrisRtnValue(joInitRtn, out errMsg) != 0)
  152. {
  153. outParam = JsonHelper.setExceptionJson(-100, "init(HIS医保环境初始化)", errMsg).ToString();
  154. return -1;
  155. }
  156. else
  157. {
  158. return 0;
  159. }
  160. }
  161. catch (Exception ex)
  162. {
  163. outParam = JsonHelper.setExceptionJson(-100, "init(HIS医保环境初始化)异常", ex.Message).ToString();
  164. return -1;
  165. }
  166. }
  167. /// <summary>
  168. /// 获取患者信息
  169. /// </summary>
  170. /// <param name="InParam"></param>
  171. /// <returns></returns>
  172. public string GetPatientInfo(string InParam)
  173. {
  174. Global.writeLog("GetPatientInfo入参:" + JsonHelper.Compress(InParam));
  175. //设置返回值,错误信息
  176. int errCode;
  177. string errMsg, rtnResult = "",outParam;
  178. //BS架构调用方式问题,每次调用都需要重新初始化
  179. if (init(InParam,out outParam)!= 0)
  180. {
  181. rtnResult = outParam;
  182. return rtnResult;
  183. }
  184. JObject joInParam = JObject.Parse(InParam);
  185. string businessType = JsonHelper.getDestValue(joInParam,"businessType");
  186. try
  187. {
  188. switch (businessType)
  189. {
  190. case "M1"://门诊读卡
  191. {
  192. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  193. if (hBus.readCard(out outParam) != 0)
  194. {
  195. rtnResult = JsonHelper.setExceptionJson(-100, "门诊读卡失败!", outParam).ToString();
  196. }
  197. else
  198. {
  199. //展示患者信息界面
  200. if (hBus.showPatInfo(outParam, out outParam) != 0)
  201. {
  202. rtnResult = outParam;
  203. }
  204. else
  205. {
  206. rtnResult = JsonHelper.setIrisReturnValue(0, "", JObject.Parse(outParam)).ToString();
  207. }
  208. }
  209. break;
  210. }
  211. case "Z1"://住院读卡
  212. {
  213. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  214. if (hBus.readCard(out outParam) != 0)
  215. {
  216. rtnResult = JsonHelper.setExceptionJson(-100, "住院读卡失败!", outParam).ToString();
  217. }
  218. else
  219. {
  220. string patInfo = outParam;
  221. //展示患者信息界面
  222. if (hBus.showPatInfo(patInfo, out outParam) != 0)
  223. {
  224. rtnResult = outParam;
  225. }
  226. else
  227. {
  228. rtnResult = JsonHelper.setIrisReturnValue(0,"",JObject.Parse(outParam)).ToString();
  229. }
  230. }
  231. break;
  232. }
  233. }
  234. return rtnResult;
  235. }
  236. catch (Exception ex)
  237. {
  238. rtnResult = JsonHelper.setIrisReturnValue(-1 , "GetPatientInfo发生异常;" + ex.Message,null).ToString();
  239. return rtnResult;
  240. }
  241. finally
  242. {
  243. Global.writeLog("GetPatientInfo出参:" + JsonHelper.Compress(rtnResult));
  244. }
  245. }
  246. /// <summary>
  247. /// 登记
  248. /// </summary>
  249. /// <param name="InParam"></param>
  250. /// <returns></returns>
  251. public string Register(string InParam)
  252. {
  253. Global.writeLog("Register 入参:" + JsonHelper.Compress(InParam));
  254. //设置返回值,错误信息
  255. string errMsg, rtnResult = "", outParam;
  256. try
  257. {
  258. //解析入参
  259. if (parseInparam(InParam, out errMsg) != 0)
  260. {
  261. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  262. return rtnResult;
  263. }
  264. //BS架构调用方式问题,每次调用都需要重新初始化
  265. if (init(InParam, out outParam) != 0)
  266. {
  267. rtnResult = outParam;
  268. return rtnResult;
  269. }
  270. //获取pat
  271. hBus.GetRegPatInfo(businessType, joInParam, out Global.pat);
  272. switch (businessType)
  273. {
  274. case "M2"://门诊登记
  275. {
  276. break;
  277. }
  278. case "M2C"://门诊登记撤销
  279. {
  280. break;
  281. }
  282. case "Z0"://住院修改
  283. {
  284. break;
  285. }
  286. case "Z2"://入院登记
  287. {
  288. Global.pat.RYorCY = "1"; //1入院2出院
  289. string regInParam = "";
  290. //校验HIS姓名与医保姓名是否一致
  291. if (hBus.checkName(Global.pat.name, out errMsg) != 0)
  292. {
  293. rtnResult = JsonHelper.setExceptionJson(-1, "校验HIS与医保姓名是否一致", errMsg).ToString();
  294. return rtnResult;
  295. }
  296. //显示登记面板
  297. if (hBus.showInPatRegisterForm( out regInParam) == 0)
  298. {
  299. JObject joRegIn_plain = JObject.Parse(JsonHelper.setCenterInpar_plain("2401", regInParam));
  300. JObject joRegIn = JObject.Parse(JsonHelper.setCenterInpar("2401", regInParam));
  301. //上传给中心
  302. JObject joRegOut = invoker.invokeCenterService("2401", joRegIn);
  303. //将中心返回的结果返回HIS,调用HIS服务进行保存
  304. if (JsonHelper.parseCenterRtnValue(joRegOut,out errMsg) == 0)
  305. {
  306. joRegOut.Add("validflag",1);
  307. joRegOut.Add("regstate", 1);
  308. joRegOut.Add("type", 1);
  309. Global.pat.mdtrtID = JsonHelper.getDestValue(joRegOut, "output.result.mdtrt_id");
  310. //插入患者本次就诊用的参保信息
  311. if (hBus.insertPatCurInsuInfo(JsonHelper.getDestValue(joParam, "patientInfo"), out outParam) != 0)
  312. {
  313. if (DialogResult.Yes == MessageBox.Show(outParam, " 是否继续? ", MessageBoxButtons.YesNo))
  314. {
  315. }
  316. else
  317. {
  318. rtnResult = JsonHelper.setExceptionJson(-1, "插入患者本次就诊用的参保信息,请联系管理员!", outParam).ToString();
  319. return rtnResult;
  320. }
  321. }
  322. //插入医保平台
  323. if (mIS.saveInpatRegisterInfo(joRegIn_plain, joRegOut, out outParam) != 0)
  324. {
  325. rtnResult = JsonHelper.setExceptionJson(-1, "云平台保存登记信息", outParam).ToString();
  326. return rtnResult;
  327. }
  328. JObject joOutput = new JObject();
  329. joOutput.Add("output", JObject.Parse(JsonHelper.getDestValue(joParam, "patientInfo.output")));
  330. //插入医保平台全量信息表
  331. if (mIS.saveMIPatFullInsuInfo(joOutput, out outParam) != 0)
  332. {
  333. rtnResult = JsonHelper.setExceptionJson(-1, "云平台保存登记全量信息失败", outParam).ToString();
  334. return rtnResult;
  335. }
  336. //插入费用核查表 入院登记
  337. if (mIS.saveDischargeAudit(3, 2,0, joRegIn, out outParam) != 0)
  338. {
  339. rtnResult = JsonHelper.setExceptionJson(-1, "云平台保存费用核查入院登记信息", outParam).ToString();
  340. return rtnResult;
  341. }
  342. //插入费用核查表 出院登记 默认,具体需要最终审核
  343. JObject joDisReg = (JObject)joRegIn.DeepClone();
  344. //joDisReg["input"]["mdtrtinfo"]["psn_setlway"] = new JObject();
  345. joDisReg["input"]["mdtrtinfo"]["psn_setlway"] = "01";
  346. //joDisReg["input"]["mdtrtinfo"]["acct_used_flag"] = new JObject();
  347. joDisReg["input"]["mdtrtinfo"]["acct_used_flag"] = "1";
  348. //joDisReg["input"]["mdtrtinfo"]["mid_setl_flag"] = new JObject();
  349. joDisReg["input"]["mdtrtinfo"]["mid_setl_flag"] = "0";
  350. if (mIS.saveDischargeAudit(3, 3,0,joDisReg, out outParam) != 0)
  351. {
  352. rtnResult = JsonHelper.setExceptionJson(-1, "云平台保存费用核查出院登记信息(默认)", outParam).ToString();
  353. return rtnResult;
  354. }
  355. //返回登记信息,插入HIS
  356. if (hIS.returnRegisterInfo(joRegIn_plain, joRegOut, out outParam) != 0)
  357. {
  358. rtnResult = JsonHelper.setExceptionJson(-1, "HIS平台保存登记信息", outParam).ToString();
  359. return rtnResult;
  360. }
  361. else
  362. {
  363. rtnResult = JsonHelper.setIrisReturnValue(0, "登记成功", null).ToString();
  364. return rtnResult;
  365. }
  366. }
  367. else
  368. {
  369. rtnResult = JsonHelper.setExceptionJson(-1, "展示登记界面", errMsg).ToString();
  370. return rtnResult;
  371. }
  372. }
  373. else
  374. {
  375. rtnResult = JsonHelper.setExceptionJson(-1, "展示登记界面", regInParam).ToString();
  376. return rtnResult;
  377. }
  378. }
  379. case "Z2C"://入院登记取消
  380. {
  381. //if (DialogResult.Yes == MessageBox.Show("即将进行取消中心医保登记,确定继续吗?", " 询问? ", MessageBoxButtons.YesNo))
  382. //{
  383. //}
  384. //else
  385. //{
  386. // rtnResult = JsonHelper.setExceptionJson(-1, "收费员撤销取消登记操作!", outParam).ToString();
  387. // return rtnResult;
  388. //}
  389. //取消中心登记
  390. if (cBus.cancleRegister("2404", out outParam) != 0)
  391. {
  392. //如果医保中心没有HIS所传的医保登记信息则默认撤销HIS登记信息
  393. int i = outParam.IndexOf("不存在有效的就诊登记信息");
  394. if (i != 0)
  395. {
  396. if (DialogResult.Yes != MessageBox.Show("医保中心提示:" + outParam+ ",是否强制撤销HIS医保登记信息?", "提示", MessageBoxButtons.YesNo))
  397. {
  398. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记失败,", outParam).ToString();
  399. return rtnResult;
  400. }
  401. }
  402. else
  403. {
  404. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记失败,", outParam).ToString();
  405. return rtnResult;
  406. }
  407. }
  408. //取消医保平台登记
  409. if (mIS.cancleRegister(1, out outParam) != 0)
  410. {
  411. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记成功,但云医保平台取消失败,", outParam).ToString();
  412. return rtnResult;
  413. }
  414. ////取消费用审核
  415. //if (mIS.cancleRegister(1, out outParam) != 0)
  416. //{
  417. // rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记成功,但云医保平台取消失败,", outParam).ToString();
  418. // return rtnResult;
  419. //}
  420. //取消HIS 登记
  421. if (hIS.cancleRegister( out outParam) != 0)
  422. {
  423. rtnResult = JsonHelper.setExceptionJson(-1, "中心和云医保平台取消登记成功,但HIS取消失败,", outParam).ToString();
  424. return rtnResult;
  425. }
  426. else
  427. {
  428. //CM 20230602 删除医保平台医保费用明细上传表数据
  429. mIS.deleteFee(out errMsg);
  430. rtnResult = JsonHelper.setIrisReturnValue(0, "取消医保登记成功", null).ToString();
  431. return rtnResult;
  432. }
  433. }
  434. case "Z6"://出院登记
  435. {
  436. break;
  437. }
  438. case "Z6C"://出院登记取消
  439. {
  440. if (cBus.cancleRegister("2405", out errMsg) != 0)
  441. {
  442. rtnResult = JsonHelper.setExceptionJson(-1, "取消出院登记", errMsg).ToString();
  443. return rtnResult;
  444. }
  445. else
  446. {
  447. rtnResult = JsonHelper.setIrisReturnValue(0, "取消出院登记成功", null).ToString();
  448. return rtnResult;
  449. }
  450. break;
  451. }
  452. default:
  453. {
  454. rtnResult = JsonHelper.setExceptionJson(-1, "Register 交易", "传入的业务编码不对!").ToString();
  455. return rtnResult;
  456. }
  457. }
  458. }
  459. catch (Exception ex)
  460. {
  461. rtnResult = JsonHelper.setIrisReturnValue(-1, "Register 发生异常;" + ex.Message, null).ToString();
  462. return rtnResult;
  463. }
  464. finally
  465. {
  466. Global.writeLog("Register 出参:" + JsonHelper.Compress(rtnResult));
  467. }
  468. return "";
  469. }
  470. /// <summary>
  471. /// 费用上传
  472. /// </summary>
  473. /// <param name="InParam"></param>
  474. /// <returns></returns>
  475. public string FeeUpload(string InParam)
  476. {
  477. Global.writeLog("FeeUpload 入参:" + JsonHelper.Compress(InParam));
  478. //设置返回值,错误信息
  479. int errCode;
  480. string errMsg, rtnResult = "", outParam;
  481. try
  482. {
  483. //解析入参
  484. if (parseInparam(InParam, out errMsg) != 0)
  485. {
  486. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  487. return rtnResult;
  488. }
  489. //BS架构调用方式问题,每次调用都需要重新初始化
  490. if (init(InParam, out outParam) != 0)
  491. {
  492. rtnResult = outParam;
  493. return rtnResult;
  494. }
  495. //获取pat
  496. hBus.GetFeeHisInfo(businessType, joInParam, out Global.pat);
  497. switch (businessType)
  498. {
  499. case "M3"://门诊费用上传
  500. {
  501. break;
  502. }
  503. case "M3C"://门诊费用撤销
  504. {
  505. break;
  506. }
  507. case "Z3"://入院费用上传
  508. {
  509. //从医保平台获取患者详细的医保登记信息
  510. if (mIS.queryRegisterInfo(1, out outParam) != 0)
  511. {
  512. rtnResult = JsonHelper.setExceptionJson(-1, "查询患者云平台登记信息", outParam).ToString();
  513. return rtnResult;
  514. }
  515. JObject joReg = JObject.Parse(outParam);
  516. Global.pat.medType = JsonHelper.getDestValue(joReg, "data.MedicalType");
  517. Global.pat.insuType = JsonHelper.getDestValue(joReg, "data.InsuType");
  518. //先取消中心费用传送
  519. cBus.cancleFeeUpload("2302", out errMsg);
  520. //再删除医保传送表的数据
  521. mIS.deleteFee( out errMsg);
  522. #region【住院费用上传前调用3101事前服务】
  523. //1.获取3101入参报文
  524. if (hIS.GetInsuPatInfo("5", Global.pat, out outParam) != 0)
  525. {
  526. rtnResult = JsonHelper.setExceptionJson(-1, "获取3101医保明细审核事前分析服务入参失败:", outParam).ToString();
  527. return rtnResult;
  528. }
  529. else
  530. {
  531. //2.调用医保3101明细审核事前分析服务
  532. JObject joInput = new JObject();
  533. joInput = JObject.Parse(outParam);
  534. JObject jo3101Rtn = invoker.invokeCenterService("3101", JsonHelper.setCenterInpar("3101", joInput.ToString().Replace("\r\n", "")));
  535. if (JsonHelper.parseCenterRtnValue(jo3101Rtn, out errMsg) != 0)
  536. {
  537. rtnResult = JsonHelper.setExceptionJson(-1, "【3101】医保明细审核事前分析服务调用失败:", errMsg).ToString();
  538. return rtnResult;
  539. }
  540. else
  541. {
  542. JArray jaResult = JArray.Parse(JsonHelper.getDestValue(jo3101Rtn, "output.result"));
  543. if (jaResult.HasValues)
  544. {
  545. PreAndInProcessAnalysisForm paipaForm = new PreAndInProcessAnalysisForm(jo3101Rtn);
  546. if (paipaForm.ShowDialog() != DialogResult.OK)
  547. {
  548. errMsg = "事前事中审核不通过,操作员取消!";
  549. rtnResult = JsonHelper.setExceptionJson(-1, "【3101】医保明细审核事前分析服务调用失败:", errMsg).ToString();
  550. return rtnResult;
  551. }
  552. }
  553. }
  554. }
  555. #endregion
  556. //开始进行费用传送
  557. //调用HIS费用查询信息
  558. if (hIS.getHisFee(Global.pat, out outParam) != 0)
  559. {
  560. rtnResult = JsonHelper.setExceptionJson(-1, "获取HIS费用", outParam).ToString();
  561. return rtnResult;
  562. }
  563. //调用医保平台转换
  564. JObject joHisFee = JObject.Parse(outParam);
  565. if (mIS.convertHisFeeWithInsuCode(joHisFee,out outParam) != 0)
  566. {
  567. rtnResult = JsonHelper.setExceptionJson(-1, "转换HIS费用", outParam).ToString();
  568. return rtnResult;
  569. }
  570. JArray jaFeeDetail = JArray.Parse(JsonHelper.getDestValue(JObject.Parse(outParam), "data"));
  571. //按指定条数分割后上传,保存,更新
  572. if (hBus.uploadFeeToCenter("2301",10, jaFeeDetail, out outParam) != 0)
  573. {
  574. rtnResult = JsonHelper.setExceptionJson(-1, "上传费用", outParam).ToString();
  575. return rtnResult;
  576. }
  577. else
  578. {
  579. rtnResult = JsonHelper.setIrisReturnValue(0, "住院费用上传成功", null).ToString();
  580. return rtnResult;
  581. }
  582. }
  583. case "Z3C"://住院费用上传取消
  584. {
  585. if (cBus.cancleFeeUpload("2302", out errMsg) != 0)
  586. {
  587. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心费用", errMsg).ToString();
  588. return rtnResult;
  589. }
  590. if (mIS.deleteFee( out errMsg) != 0)
  591. {
  592. rtnResult = JsonHelper.setExceptionJson(-1, "删除医保平台费用", errMsg).ToString();
  593. return rtnResult;
  594. }
  595. else
  596. {
  597. rtnResult = JsonHelper.setIrisReturnValue(0, "住院费用上传取消成功", null).ToString();
  598. return rtnResult;
  599. }
  600. }
  601. default:
  602. {
  603. rtnResult = JsonHelper.setExceptionJson(-1, "FeeUpload 交易", "传入的业务编码不对!").ToString();
  604. return rtnResult;
  605. }
  606. }
  607. return rtnResult;
  608. }
  609. catch (Exception ex)
  610. {
  611. rtnResult = JsonHelper.setExceptionJson(-1, "FeeUpload 交易", ex.Message).ToString();
  612. return rtnResult;
  613. }
  614. finally
  615. {
  616. Global.writeLog("FeeUpload 出参:" + JsonHelper.Compress(rtnResult));
  617. }
  618. }
  619. /// <summary>
  620. /// 结算
  621. /// </summary>
  622. /// <param name="InParam"></param>
  623. /// <returns></returns>
  624. public string Settlement(string InParam)
  625. {
  626. Global.writeLog("Settlement 入参:" + JsonHelper.Compress(InParam));
  627. //设置返回值,错误信息
  628. string errMsg, rtnResult = "", outParam;
  629. try
  630. {
  631. //解析入参
  632. if (parseInparam(InParam, out errMsg) != 0)
  633. {
  634. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  635. return rtnResult;
  636. }
  637. //BS架构调用方式问题,每次调用都需要重新初始化
  638. if (init(InParam, out outParam) != 0)
  639. {
  640. rtnResult = outParam;
  641. return rtnResult;
  642. }
  643. //获取pat
  644. hBus.GetSettlementHisInfo(businessType, joInParam, out Global.pat);
  645. CardReader_GS CardRead_GS = new CardReader_GS();
  646. switch (businessType)
  647. {
  648. case "M4"://门诊预结算
  649. {
  650. OutpatientRegistration frmReg = new OutpatientRegistration();
  651. if (frmReg.ShowDialog() == DialogResult.OK)
  652. {
  653. rtnResult = "调用结束";
  654. }
  655. break;
  656. }
  657. case "M4C"://门诊预结算撤销
  658. {
  659. break;
  660. }
  661. case "M5"://门诊结算
  662. {
  663. Global.pat.admType = 1;
  664. string patInfo ="";
  665. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  666. if (hBus.readCard(out outParam) != 0)
  667. {
  668. rtnResult = JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
  669. return rtnResult;
  670. }
  671. else
  672. {
  673. patInfo = outParam;
  674. //展示患者信息界面
  675. if (hBus.showPatInfo(patInfo, out outParam) != 0)
  676. {
  677. rtnResult = outParam;
  678. return rtnResult;
  679. }
  680. }
  681. //患者信息赋值给全局变量
  682. patInfo = outParam;
  683. if (hBus.setGlobalPatAfaterShowPatInfo(patInfo, out errMsg) != 0)
  684. {
  685. rtnResult = JsonHelper.setExceptionJson(-1, "setGlobalPatAfaterShowPatInfo", errMsg).ToString();
  686. return rtnResult;
  687. }
  688. //校验HIS姓名与医保姓名是否一致
  689. if (hBus.checkName(Global.pat.name, out errMsg) != 0)
  690. {
  691. rtnResult = JsonHelper.setExceptionJson(-1, "校验HIS与医保姓名是否一致", errMsg).ToString();
  692. return rtnResult;
  693. }
  694. //显示登记面板
  695. if (hBus.showOutPatRegisterForm(out outParam) != 0)
  696. {
  697. rtnResult = JsonHelper.setExceptionJson(-1, "显示登记面板", outParam).ToString();
  698. return rtnResult;
  699. }
  700. JObject joReg = JObject.Parse(outParam);
  701. //医保挂号
  702. JObject jo2201Inpar = JObject.Parse(JsonHelper.getDestProperty(joReg, "data"));
  703. JObject jo2201Inpar_plain = JObject.Parse(JsonHelper.getDestProperty(joReg, "data"));
  704. jo2201Inpar = JObject.Parse(JsonHelper.setCenterInpar("2201", jo2201Inpar));
  705. jo2201Inpar_plain = JObject.Parse(JsonHelper.setCenterInpar_plain("2201", jo2201Inpar_plain));
  706. //此处先取到就诊信息上传的入参,只要挂号成功就保存到云HIS后台(保存后台需要用到2203入参)
  707. JObject jo2203Inpar = new JObject();
  708. JObject jo2203Inpar_plain = new JObject();
  709. jo2203Inpar.Add("mdtrtinfo", JObject.Parse(JsonHelper.getDestValue(joReg, "mdtrtinfo")));
  710. jo2203Inpar.Add("diseinfo",JArray.Parse(JsonHelper.getDestValue(joReg, "diseinfo")));
  711. JObject jo2201Rtn = invoker.invokeCenterService("2201", jo2201Inpar);
  712. if (JsonHelper.parseCenterRtnValue(jo2201Rtn, out errMsg) != 0)
  713. {
  714. rtnResult = JsonHelper.setExceptionJson(-1, "医保挂号", errMsg).ToString();
  715. return rtnResult;
  716. }
  717. else
  718. {
  719. Global.pat.mdtrtID = JsonHelper.getDestValue(jo2201Rtn, "output.data.mdtrt_id");
  720. //插入患者本次就诊用的参保信息
  721. if (hBus.insertPatCurInsuInfo(patInfo, out outParam) != 0)
  722. {
  723. if (DialogResult.Yes != MessageBox.Show(outParam, " 是否继续? ", MessageBoxButtons.YesNo))
  724. {
  725. rtnResult = JsonHelper.setExceptionJson(-1, "插入患者本次就诊用的参保信息,请联系管理员!是否继续?", outParam).ToString();
  726. return rtnResult;
  727. }
  728. }
  729. jo2203Inpar["mdtrtinfo"]["mdtrt_id"] = Global.pat.mdtrtID;
  730. jo2203Inpar_plain = JObject.Parse(JsonHelper.setCenterInpar_plain("2203", jo2203Inpar));
  731. jo2203Inpar = JObject.Parse(JsonHelper.setCenterInpar("2203", jo2203Inpar));
  732. //门诊登记信息,插入云医保平台
  733. jo2201Rtn.Add("validflag", 1);
  734. jo2201Rtn.Add("regstate", 1);
  735. jo2201Rtn.Add("type", 3);
  736. Global.writeLog(jo2201Inpar_plain.ToString());
  737. if (mIS.saveOutpatRegisterInfo(jo2201Inpar_plain, jo2201Rtn, jo2203Inpar_plain, out errMsg) != 0)
  738. {
  739. rtnResult = JsonHelper.setExceptionJson(-1, "中心登记成功但医保平台保存失败,请联系管理员!", errMsg).ToString();
  740. return rtnResult;
  741. }
  742. }
  743. //门诊就诊信息上传
  744. JObject jo2203Rtn = invoker.invokeCenterService("2203",jo2203Inpar );
  745. if (JsonHelper.parseCenterRtnValue(jo2203Rtn, out errMsg) != 0)
  746. {
  747. rtnResult = JsonHelper.setExceptionJson(-1, "门诊就诊信息上传", errMsg).ToString();
  748. return rtnResult;
  749. }
  750. #region【门诊就诊信息上传成功后调用3101事前服务】
  751. //1.获取3101入参报文
  752. if (Global.curEvt.ext.isOpenAnalysis)
  753. {
  754. if (hIS.GetInsuPatInfo("1", Global.pat, out outParam) != 0)
  755. {
  756. rtnResult = JsonHelper.setExceptionJson(-1, "获取3101医保明细审核事前分析服务入参失败:", outParam).ToString();
  757. return rtnResult;
  758. }
  759. else
  760. {
  761. //2.调用医保3101明细审核事前分析服务
  762. JObject joInput = new JObject();
  763. //joInput.Add("data", JObject.Parse(outParam));
  764. joInput = JObject.Parse(outParam);
  765. JObject jo3101Rtn = invoker.invokeCenterService("3101", JsonHelper.setCenterInpar("3101", joInput.ToString().Replace("\r\n", ""))); //.Replace(" ", "")
  766. if (JsonHelper.parseCenterRtnValue(jo3101Rtn, out errMsg) != 0)
  767. {
  768. rtnResult = JsonHelper.setExceptionJson(-1, "【3101】医保明细审核事前分析服务调用失败:", errMsg).ToString();
  769. return rtnResult;
  770. }
  771. else
  772. {
  773. JArray jaResult = JArray.Parse(JsonHelper.getDestValue(jo3101Rtn, "output.result"));
  774. if (jaResult.HasValues)
  775. {
  776. PreAndInProcessAnalysisForm paipaForm = new PreAndInProcessAnalysisForm(jo3101Rtn);
  777. if (paipaForm.ShowDialog() != DialogResult.OK)
  778. {
  779. errMsg = "事前事中审核不通过,操作员取消!";
  780. rtnResult = JsonHelper.setExceptionJson(-1, "【3101】医保明细审核事前分析服务调用失败:", errMsg).ToString();
  781. return rtnResult;
  782. }
  783. }
  784. }
  785. }
  786. }
  787. #endregion
  788. //费用上传
  789. if (hBus.uploadFee("2204", 50, out outParam) != 0)
  790. {
  791. rtnResult = JsonHelper.setExceptionJson(-1, "费用上传", outParam).ToString();
  792. return rtnResult;
  793. }
  794. #region【门诊预结算2206前调用3102医保明细审核事中服务】
  795. if (Global.curEvt.ext.isOpenAnalysis)
  796. {
  797. //1.获取3102入参报文
  798. if (hIS.GetInsuPatInfo("2", Global.pat, out outParam) != 0)
  799. {
  800. rtnResult = JsonHelper.setExceptionJson(-1, "获取3102医保明细审核事中分析服务入参失败:", outParam).ToString();
  801. return rtnResult;
  802. }
  803. else
  804. {
  805. //2.调用医保3102明细审核事前分析服务
  806. JObject joInput = new JObject();
  807. //joInput.Add("data", JObject.Parse(outParam));
  808. joInput = JObject.Parse(outParam);
  809. JObject jo3102Rtn = invoker.invokeCenterService("3102", JsonHelper.setCenterInpar("3102", joInput.ToString().Replace("\r\n", "")));
  810. if (JsonHelper.parseCenterRtnValue(jo3102Rtn, out errMsg) != 0)
  811. {
  812. rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
  813. return rtnResult;
  814. }
  815. else
  816. {
  817. JArray jaResult = JArray.Parse(JsonHelper.getDestValue(jo3102Rtn, "output.result"));
  818. if (jaResult.HasValues)
  819. {
  820. PreAndInProcessAnalysisForm paipaForm = new PreAndInProcessAnalysisForm(jo3102Rtn);
  821. if (paipaForm.ShowDialog() != DialogResult.OK)
  822. {
  823. errMsg = "事前事中审核不通过,操作员取消!";
  824. rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
  825. return rtnResult;
  826. }
  827. }
  828. }
  829. }
  830. }
  831. #endregion
  832. //调用IRIS获取医保各项金额
  833. if (mIS.getSumFee(out outParam) != 0)
  834. {
  835. rtnResult = JsonHelper.setExceptionJson(-1, "获取医保费用各项汇总金额", outParam).ToString();
  836. return rtnResult;
  837. }
  838. JObject joSumFee = JObject.Parse(outParam);
  839. JObject joSettlement = JObject.Parse(JsonHelper.getDestValue(joReg, "settlement"));
  840. //修改joSettlement的就诊ID ,总金额等
  841. joSettlement["mdtrt_id"] = Global.pat.mdtrtID;
  842. joSettlement["medfee_sumamt"] = JsonHelper.getDestValue(joSumFee, "data.Sumamt");
  843. //预结算2206
  844. if (hBus.preSettlement_OutPat(joSettlement, out outParam) != 0)
  845. {
  846. rtnResult = JsonHelper.setExceptionJson(-1, "结算信息展示", outParam).ToString();
  847. return rtnResult;
  848. }
  849. #region【门诊正式结算前调用社保卡验密】
  850. if ((Global.pat.mdtrtcertType == "03") && (Global.pat.insuplc_admdvs.Substring(0, 2) == "62"))
  851. {
  852. if (CardRead_GS.VerifyPIN(out outParam) != 0)
  853. {
  854. rtnResult = JsonHelper.setExceptionJson(-1, "社保卡验密异常iVerifyPIN失败 ", outParam).ToString();
  855. return rtnResult;
  856. }
  857. }
  858. #endregion
  859. //正式结算
  860. JObject joData = new JObject();
  861. joData.Add("data",joSettlement);
  862. JObject joRtn = invoker.invokeCenterService("2207", JsonHelper.setCenterInpar("2207", joData));
  863. if (JsonHelper.parseCenterRtnValue(joRtn, out errMsg) != 0)
  864. {
  865. rtnResult = JsonHelper.setExceptionJson(-1, "结算失败", errMsg).ToString();
  866. return rtnResult;
  867. }
  868. else
  869. {
  870. //返回给云医保平台结算信息
  871. if (mIS.saveSettlement(joRtn, out errMsg) != 0)
  872. {
  873. rtnResult = JsonHelper.setExceptionJson(-1, "结算成功,但云医保平台保存失败", errMsg).ToString();
  874. return rtnResult;
  875. }
  876. //返回给云医保平台结算明细信息
  877. if (mIS.saveSettlementDetail(joRtn, out errMsg) != 0)
  878. {
  879. rtnResult = JsonHelper.setExceptionJson(-1, "云医保平台保存结算明细失败", errMsg).ToString();
  880. return rtnResult;
  881. }
  882. //返回给HIS
  883. JObject joSetlinfo = JObject.Parse(JsonHelper.getDestValue(joRtn, "output.setlinfo"));
  884. if (hIS.returnOutpatSettlementInfo(joSettlement, joSetlinfo, out outParam) != 0)
  885. {
  886. rtnResult = JsonHelper.setExceptionJson(-1, "返回结算信息给HIS", outParam).ToString();
  887. return rtnResult;
  888. }
  889. else
  890. {
  891. JObject joHisServieRtn = JObject.Parse(outParam);
  892. hBus.returnToFrontEndAfterSettlement(joRtn, joHisServieRtn, out outParam);
  893. rtnResult = JsonHelper.setIrisReturnValue(0, "结算成功", JObject.Parse(outParam)).ToString();
  894. return rtnResult;
  895. }
  896. }
  897. }
  898. case "M5C"://门诊结算撤销
  899. {
  900. //查询HIS医保结算记录表获取该病人的参保地
  901. string sqlStr = "SELECT * FROM BS_MedInsuSettlement WHERE billType = 1 and ValidFlag = 1 ";
  902. sqlStr = sqlStr + " AND Hospital_Dr=" + Global.inf.hospitalDr + " AND Interface_Dr=" + Global.inf.interfaceDr;
  903. sqlStr = sqlStr + " AND SettlementID ='" + Global.pat.settlID + "'";
  904. JObject joSql = new JObject();
  905. joSql.Add("sqlStr", sqlStr);
  906. JObject joSettlInfo = mIS.QuerySettlementInfo(joSql);
  907. //if (JsonHelper.parseIrisRtnValue(joSettlInfo, out errMsg) != 0)
  908. //{
  909. // rtnResult = JsonHelper.setExceptionJson(-1, "查询结算信息失败!", errMsg).ToString();
  910. // return rtnResult;
  911. //}
  912. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joSettlInfo, "result.data[0].insuplc_admdvs");
  913. //退中心结算
  914. string newSettleID = "";
  915. if (cBus.cancleSettlement("2208", out outParam) != 0)
  916. {
  917. int i = outParam.IndexOf("获取到的就诊信息为无效状态,不能办理结算撤销业务");
  918. if (i != 0)
  919. {
  920. if (DialogResult.Yes != MessageBox.Show("医保中心提示:" + outParam + ",是否强制撤销HIS结算信息?", "提示", MessageBoxButtons.YesNo))
  921. {
  922. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消结算失败,", outParam).ToString();
  923. return rtnResult;
  924. }
  925. newSettleID = "YC";
  926. }
  927. else
  928. {
  929. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心结算", outParam).ToString();
  930. //查看是医保平台是否已经退费,如果是,则询问是否继续退费
  931. string SqlStr = " SELECT * FROM BS_MedInsuSettlement WHERE ValidFlag = 0 AND BillType = -1 ";
  932. SqlStr = SqlStr + " AND Hospital_Dr=" + Global.inf.hospitalDr + " AND Interface_Dr=" + Global.inf.interfaceDr;
  933. SqlStr = SqlStr + " AND SettlementID ='" + Global.pat.settlID + "'";
  934. JObject joSqlStr = new JObject();
  935. joSqlStr.Add("sqlStr", SqlStr);
  936. JObject joCancleSettlInfo = mIS.QuerySettlementInfo(joSqlStr);
  937. JArray jaCancleSettlInfo = JArray.Parse(JsonHelper.getDestValue(joCancleSettlInfo, "result.data"));
  938. if (jaCancleSettlInfo.Count == 1)
  939. {
  940. //询问收款员是否继续进行HIS退费
  941. if (DialogResult.Yes == MessageBox.Show("中心提示:" + outParam, " 该费用在医保中心已成功退费但在HIS未成功退费,是否强制退HIS费用? ", MessageBoxButtons.YesNo))
  942. {
  943. rtnResult = JsonHelper.setExceptionJson(0, "该费用在医保中心已成功退费但在HIS未成功退费,收款员选择强制退HIS费用!", outParam).ToString();
  944. }
  945. }
  946. else
  947. {
  948. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心结算(云医保平台未退费或未查询到退费记录)", outParam).ToString();
  949. }
  950. return rtnResult;
  951. }
  952. }
  953. else
  954. {
  955. newSettleID = JsonHelper.getDestValue(JObject.Parse(outParam), "output.setlinfo.setl_id");
  956. }
  957. //string newSettleID = "10290453";
  958. //Global.pat.mdtrtID = "202210281547480034293700000000";
  959. //Global.pat.psn_no = "YX423049577";
  960. //Global.pat.settlID = "10290445";
  961. //退云医保平台结算
  962. if (mIS.cancleSettlement(newSettleID, out outParam) != 0)
  963. {
  964. rtnResult = JsonHelper.setExceptionJson(-1, "取消平台结算信息", outParam).ToString();
  965. //return rtnResult;
  966. }
  967. //中心取消传送
  968. if (cBus.cancleFeeUpload("2205", out errMsg) != 0)
  969. {
  970. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心费用", errMsg).ToString();
  971. return rtnResult;
  972. }
  973. //云平台取消传送
  974. if (mIS.deleteFee(out errMsg) != 0)
  975. {
  976. rtnResult = JsonHelper.setExceptionJson(-1, "删除医保平台费用", errMsg).ToString();
  977. return rtnResult;
  978. }
  979. //取消中心登记
  980. if (cBus.cancleRegister("2202", out outParam) != 0)
  981. {
  982. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记失败,", outParam).ToString();
  983. return rtnResult;
  984. }
  985. //取消医保平台登记
  986. if (mIS.cancleRegister(3, out outParam) != 0)
  987. {
  988. rtnResult = JsonHelper.setExceptionJson(-1, "中心取消登记成功,但云医保平台取消失败,", outParam).ToString();
  989. return rtnResult;
  990. }
  991. //退HIS结算
  992. if (hIS.cancleSettlementInfo(joParam, out outParam) != 0)
  993. {
  994. rtnResult = JsonHelper.setExceptionJson(-1, "取消HIS结算信息", outParam).ToString();
  995. return rtnResult;
  996. }
  997. else
  998. {
  999. rtnResult = JsonHelper.setIrisReturnValue(0, "取消结算成功", null).ToString();
  1000. return rtnResult;
  1001. }
  1002. }
  1003. case "M6"://门诊移动支付结算
  1004. {
  1005. MobilePay mp = new MobilePay(InParam, out errMsg);
  1006. if (errMsg != "")
  1007. {
  1008. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易1", errMsg).ToString();
  1009. return rtnResult;
  1010. }
  1011. if (mp.MobilePaySettlement(out outParam) != 0)
  1012. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易2", outParam).ToString();
  1013. else
  1014. rtnResult = outParam;
  1015. return rtnResult;
  1016. }
  1017. case "M6C"://门诊移动支付结算撤销
  1018. {
  1019. string onlineYBFalg = JsonHelper.getDestValue(joInsuAdmObj, "onlineYBFalg");
  1020. MobilePay mp = new MobilePay(InParam, out errMsg);
  1021. if (errMsg != "")
  1022. {
  1023. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易3", errMsg).ToString();
  1024. return rtnResult;
  1025. }
  1026. if (String.IsNullOrEmpty(onlineYBFalg))
  1027. mp.MSettl.onlineYBFalg = "N";
  1028. else
  1029. mp.MSettl.onlineYBFalg = onlineYBFalg;
  1030. if (mp.MobilePayCancelSettlement(out outParam) != 0)
  1031. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易4", outParam).ToString();
  1032. else
  1033. rtnResult = JsonHelper.setExceptionJson(0, "Settlement 交易5", outParam).ToString();
  1034. return rtnResult;
  1035. }
  1036. case "M6Confirm"://门诊移动支付确认
  1037. {
  1038. MobilePay mp = new MobilePay(InParam, out errMsg);
  1039. if (errMsg != "")
  1040. {
  1041. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易6", errMsg).ToString();
  1042. return rtnResult;
  1043. }
  1044. if (mp.MobilePayConfirmSettlement(out outParam) != 0)
  1045. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易7", outParam).ToString();
  1046. else
  1047. rtnResult = outParam;
  1048. return rtnResult;
  1049. }
  1050. case "M6CallBack"://门诊移动支付回调
  1051. {
  1052. JObject jo = JObject.Parse(InParam);
  1053. joInsuAdmObj = new JObject();
  1054. joInsuAdmObj.Add("payOrdId", "");
  1055. jo.Add("insuAdmObj", joInsuAdmObj);
  1056. MobilePay mp = new MobilePay(jo.ToString(), out errMsg);
  1057. if (errMsg != "")
  1058. {
  1059. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易8", errMsg).ToString();
  1060. return rtnResult;
  1061. }
  1062. if (mp.MobilePayCallbackSettlement(out outParam) != 0)
  1063. rtnResult = outParam;
  1064. else
  1065. rtnResult = outParam;
  1066. return rtnResult;
  1067. }
  1068. case "Z4"://住院预结算
  1069. {
  1070. #region【住院预结算2303前调用3102医保明细审核事中服务】
  1071. //1.获取3102入参报文
  1072. /*
  1073. if (hIS.GetInsuPatInfo("9", Global.pat, out outParam) != 0)
  1074. {
  1075. rtnResult = JsonHelper.setExceptionJson(-1, "获取3102医保明细审核事中分析服务入参失败:", outParam).ToString();
  1076. return rtnResult;
  1077. }
  1078. else
  1079. {
  1080. //2.调用医保3102明细审核事前分析服务
  1081. JObject joInput = new JObject();
  1082. joInput = JObject.Parse(outParam);
  1083. JObject jo3102Rtn = invoker.invokeCenterService("3102", JsonHelper.setCenterInpar("3102", joInput.ToString().Replace("\r\n", "")));
  1084. if (JsonHelper.parseCenterRtnValue(jo3102Rtn, out errMsg) != 0)
  1085. {
  1086. DialogResult dr = MessageBox.Show("【3102】医保明细审核事中分析服务医保中心返回结果2:" + errMsg + "!是否继续?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
  1087. if (dr != DialogResult.OK)
  1088. {
  1089. rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
  1090. return rtnResult;
  1091. }
  1092. }
  1093. }
  1094. */
  1095. #endregion
  1096. Global.pat.RYorCY = "2";
  1097. Global.pat.admType = 2;
  1098. JObject joSettle = new JObject();
  1099. if (hBus.preSettlement("2303",out joSettle, out outParam) != 0)
  1100. {
  1101. rtnResult = JsonHelper.setExceptionJson(-1, "结算信息展示", outParam).ToString();
  1102. return rtnResult;
  1103. }
  1104. else
  1105. {
  1106. rtnResult = JsonHelper.setIrisReturnValue(0, "预结算成功", null).ToString();
  1107. return rtnResult;
  1108. }
  1109. }
  1110. case "Z4C"://住院预结算撤销
  1111. {
  1112. rtnResult = JsonHelper.setExceptionJson(-100, "该接口不支持预结算取消!", null).ToString();
  1113. return rtnResult;
  1114. }
  1115. case "Z5"://住院结算
  1116. {
  1117. //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  1118. string patInfo = "";
  1119. if (hBus.readCard(out outParam) != 0)
  1120. {
  1121. rtnResult = JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
  1122. return rtnResult;
  1123. }
  1124. else
  1125. {
  1126. patInfo = outParam;
  1127. //展示患者信息界面
  1128. if (hBus.showPatInfo(patInfo, out outParam) != 0)
  1129. {
  1130. rtnResult = outParam;
  1131. return rtnResult;
  1132. }
  1133. else
  1134. {
  1135. if (hBus.setGlobalPatAfaterShowPatInfo(outParam, out errMsg) != 0)
  1136. {
  1137. rtnResult = JsonHelper.setExceptionJson(-1, "setGlobalPatAfaterShowPatInfo", errMsg).ToString();
  1138. return rtnResult;
  1139. }
  1140. //校验HIS姓名与医保姓名是否一致
  1141. if (hBus.checkName(Global.pat.name, out errMsg) != 0)
  1142. {
  1143. rtnResult = JsonHelper.setExceptionJson(-1, "校验HIS与医保姓名是否一致", errMsg).ToString();
  1144. return rtnResult;
  1145. }
  1146. }
  1147. }
  1148. #region【住院正式结算前调用社保卡验密】
  1149. if ((Global.pat.mdtrtcertType == "03") && (Global.pat.insuplc_admdvs.Substring(0, 2) == "62"))
  1150. {
  1151. if (CardRead_GS.VerifyPIN(out outParam) != 0)
  1152. {
  1153. rtnResult = JsonHelper.setExceptionJson(-1, "社保卡验密异常iVerifyPIN失败 ", outParam).ToString();
  1154. return rtnResult;
  1155. }
  1156. }
  1157. #endregion
  1158. #region【住院预结算2303前调用3102医保明细审核事中服务】
  1159. //1.获取3102入参报文
  1160. if (hIS.GetInsuPatInfo("9", Global.pat, out outParam) != 0)
  1161. {
  1162. rtnResult = JsonHelper.setExceptionJson(-1, "获取3102医保明细审核事中分析服务入参失败:", outParam).ToString();
  1163. return rtnResult;
  1164. }
  1165. else
  1166. {
  1167. //2.调用医保3102明细审核事前分析服务
  1168. JObject joInput = new JObject();
  1169. joInput = JObject.Parse(outParam);
  1170. JObject jo3102Rtn = invoker.invokeCenterService("3102", JsonHelper.setCenterInpar("3102", joInput.ToString().Replace("\r\n", "")));
  1171. if (JsonHelper.parseCenterRtnValue(jo3102Rtn, out errMsg) != 0)
  1172. {
  1173. rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
  1174. return rtnResult;
  1175. }
  1176. else
  1177. {
  1178. JArray jaResult = JArray.Parse(JsonHelper.getDestValue(jo3102Rtn, "output.result"));
  1179. if (jaResult.HasValues)
  1180. {
  1181. PreAndInProcessAnalysisForm paipaForm = new PreAndInProcessAnalysisForm(jo3102Rtn);
  1182. if (paipaForm.ShowDialog() != DialogResult.OK)
  1183. {
  1184. errMsg = "事前事中审核不通过,操作员取消!";
  1185. rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
  1186. return rtnResult;
  1187. }
  1188. }
  1189. }
  1190. }
  1191. #endregion
  1192. Global.pat.admType = 2;
  1193. Global.pat.RYorCY = "2";
  1194. JObject joPreSetOutpar ;
  1195. if (hBus.preSettlement("2303",out joPreSetOutpar, out outParam) != 0)
  1196. {
  1197. rtnResult = JsonHelper.setExceptionJson(-1, "结算信息展示", outParam).ToString();
  1198. return rtnResult;
  1199. }
  1200. else
  1201. {
  1202. JObject joSettlement = JObject.Parse(JsonHelper.getDestValue(joPreSetOutpar, "Settlement"));
  1203. //正式结算
  1204. joSettlement.Add("data", joSettlement);
  1205. JObject jo2304Rtn = invoker.invokeCenterService("2304",JsonHelper.setCenterInpar("2304",joSettlement));
  1206. if (JsonHelper.parseCenterRtnValue(jo2304Rtn, out errMsg) != 0)
  1207. {
  1208. rtnResult = JsonHelper.setExceptionJson(-1, "结算失败", errMsg).ToString();
  1209. cBus.cancleRegister("2405", out errMsg);
  1210. return rtnResult;
  1211. }
  1212. else
  1213. {
  1214. //返回给云医保平台结算信息
  1215. if (mIS.saveSettlement(jo2304Rtn, out errMsg) != 0)
  1216. {
  1217. rtnResult = JsonHelper.setExceptionJson(-1, "结算成功,但云医保平台保存失败", errMsg).ToString();
  1218. return rtnResult;
  1219. }
  1220. //返回给云医保平台结算明细信息
  1221. if (mIS.saveSettlementDetail(jo2304Rtn, out errMsg) != 0)
  1222. {
  1223. rtnResult = JsonHelper.setExceptionJson(-1, "云医保平台保存结算明细失败", errMsg).ToString();
  1224. Global.writeLog(rtnResult);
  1225. MessageBox.Show(errMsg);
  1226. }
  1227. //返回给HIS
  1228. JObject joSetlinfo = JObject.Parse(JsonHelper.getDestValue(jo2304Rtn, "output.setlinfo"));
  1229. if (hIS.returnInpatSettlementInfo(joParam, joSetlinfo, out outParam) != 0)
  1230. {
  1231. rtnResult = JsonHelper.setExceptionJson(-1, "返回结算信息给HIS", outParam).ToString();
  1232. return rtnResult;
  1233. }
  1234. else
  1235. {
  1236. //返回给前端
  1237. JObject joHisServieRtn = JObject.Parse(outParam);
  1238. hBus.returnToFrontEndAfterSettlement(jo2304Rtn, joHisServieRtn, out outParam);
  1239. rtnResult = JsonHelper.setIrisReturnValue(0, "结算成功", JObject.Parse(outParam)).ToString();
  1240. return rtnResult;
  1241. }
  1242. }
  1243. }
  1244. }
  1245. case "Z5C"://住院结算撤销
  1246. {
  1247. //查询结算表
  1248. string sqlStr = "SELECT * FROM BS_MedInsuSettlement WHERE billType = 1 and Hospital_Dr=" + Global.inf.hospitalDr
  1249. + " and Adm_Dr='" + Global.pat.adm_Dr + "'"
  1250. + " and MdtrtID='" + Global.pat.mdtrtID + "'"
  1251. + " Order By ID DESC ";
  1252. JObject joSql = new JObject();
  1253. joSql.Add("sqlStr", sqlStr);
  1254. JObject joSettlInfo = mIS.QuerySettlementInfo(joSql);
  1255. //if (JsonHelper.parseIrisRtnValue(joSettlInfo, out errMsg) != 0)
  1256. //{
  1257. // rtnResult = JsonHelper.setExceptionJson(-1, "查询结算信息失败!", errMsg).ToString();
  1258. // return rtnResult;
  1259. //}
  1260. //MessageBox.Show(joSettlInfo.ToString());
  1261. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joSettlInfo, "result.data[0].insuplc_admdvs");
  1262. Global.pat.SettID_YBJSB = JsonHelper.getDestValue(joSettlInfo, "result.data[0].SettlementID");
  1263. if (Global.pat.settlID != Global.pat.SettID_YBJSB)
  1264. {
  1265. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", "通过09010059服务获取到的SettlementID<" + Global.pat.settlID + ">与DLL通过SQL语句" +
  1266. joSql + ",获取到的SettlementID<" + Global.pat.SettID_YBJSB + ">不同,可能存在HIS单边账,请联系医保开发人员处理该笔结算记录!").ToString();
  1267. //return rtnResult;
  1268. }
  1269. Global.pat.settlID = Global.pat.SettID_YBJSB;
  1270. //取消中心结算信息
  1271. if (cBus.cancleSettlement("2305", out outParam) != 0)
  1272. {
  1273. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心结算信息失败!", outParam).ToString();
  1274. //查看是医保平台是否已经退费,如果是,则询问是否继续退费
  1275. string SqlStr = " SELECT * FROM BS_MedInsuSettlement WHERE ValidFlag = 0 AND BillType = -1 ";
  1276. SqlStr = SqlStr + " AND Hospital_Dr=" + Global.inf.hospitalDr + " AND Interface_Dr=" + Global.inf.interfaceDr;
  1277. SqlStr = SqlStr + " AND SettlementID ='" + Global.pat.settlID + "'";
  1278. JObject joSqlStr = new JObject();
  1279. joSqlStr.Add("sqlStr", SqlStr);
  1280. JObject joCancleSettlInfo = mIS.QuerySettlementInfo(joSqlStr);
  1281. JArray jaCancleSettlInfo = JArray.Parse(JsonHelper.getDestValue(joCancleSettlInfo, "result.data"));
  1282. if (jaCancleSettlInfo.Count == 1)
  1283. {
  1284. //询问收款员是否继续进行HIS退费
  1285. if (DialogResult.Yes == MessageBox.Show("中心提示:" + outParam, " 该费用在医保中心已成功退费但在HIS未成功退费,是否强制退HIS费用? ", MessageBoxButtons.YesNo))
  1286. {
  1287. rtnResult = JsonHelper.setExceptionJson(0, "该费用在医保中心已成功退费但在HIS未成功退费,收款员选择强制退HIS费用!", outParam).ToString();
  1288. }
  1289. }
  1290. else
  1291. {
  1292. rtnResult = JsonHelper.setExceptionJson(-1, "取消中心结算(云医保平台未退费或未查询到退费记录)", outParam).ToString();
  1293. }
  1294. return rtnResult;
  1295. }
  1296. else
  1297. {
  1298. //退结算会返一个新的ID
  1299. string newSettleID = JsonHelper.getDestValue(JObject.Parse(outParam), "output.setlinfo.setl_id");
  1300. //取消平台结算信息
  1301. if (mIS.cancleSettlement(newSettleID, out outParam) != 0)
  1302. {
  1303. rtnResult = JsonHelper.setExceptionJson(-1, "中心结算取消成功,医保平台结算信息取消失败!", outParam).ToString();
  1304. return rtnResult;
  1305. }
  1306. //中心取消传送
  1307. if (cBus.cancleFeeUpload("2302", out errMsg) != 0)
  1308. {
  1309. //rtnResult = JsonHelper.setExceptionJson(-1, "取消中心费用", errMsg).ToString();
  1310. //return rtnResult;
  1311. }
  1312. //云平台取消传送
  1313. if (mIS.deleteFee(out errMsg) != 0)
  1314. {
  1315. //rtnResult = JsonHelper.setExceptionJson(-1, "删除医保平台费用", errMsg).ToString();
  1316. //return rtnResult;
  1317. }
  1318. //取消HIS医保结算信息
  1319. if (hIS.cancleSettlementInfo(joParam, out outParam) != 0)
  1320. {
  1321. rtnResult = JsonHelper.setExceptionJson(-1, "中心跟医保平台结算取消成功, 取消HIS结算信息失败!", outParam).ToString();
  1322. return rtnResult;
  1323. }
  1324. //取消出院登记
  1325. if (cBus.cancleRegister("2405", out outParam) != 0)
  1326. {
  1327. rtnResult = JsonHelper.setExceptionJson(0, "中心,医保平台及HIS结算信息取消成功,取消出院登记失败!请手工取消出院登记!", outParam).ToString();
  1328. return rtnResult;
  1329. }
  1330. rtnResult = JsonHelper.setIrisReturnValue(0, "取消结算成功", null).ToString();
  1331. return rtnResult;
  1332. }
  1333. }
  1334. default:
  1335. {
  1336. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", "传入的业务编码不对!").ToString();
  1337. return rtnResult;
  1338. }
  1339. }
  1340. return rtnResult;
  1341. }
  1342. catch (Exception ex)
  1343. {
  1344. rtnResult = JsonHelper.setExceptionJson(-1, "Settlement 交易", ex.Message).ToString();
  1345. return rtnResult;
  1346. }
  1347. finally
  1348. {
  1349. Global.writeLog("Settlement 出参:" + JsonHelper.Compress(rtnResult));
  1350. }
  1351. }
  1352. //[STAThread]
  1353. //public void print(JObject joInParam)
  1354. //{
  1355. // //显示打印界面
  1356. // SettlementChecklist frmSettlList;
  1357. // string insuAdmObj = JsonHelper.getDestValue(joInParam, "insuAdmObj");
  1358. // if (insuAdmObj == "")
  1359. // {
  1360. // frmSettlList = new SettlementChecklist();
  1361. // }
  1362. // else
  1363. // {
  1364. // JObject joInsuAdmObj = JObject.Parse(insuAdmObj);
  1365. // frmSettlList = new SettlementChecklist(joInsuAdmObj);
  1366. // }
  1367. // if (frmSettlList.ShowDialog() == DialogResult.OK)
  1368. // {
  1369. // };
  1370. //}
  1371. //[STAThread]
  1372. /// <summary>
  1373. /// 辅助交易
  1374. /// </summary>
  1375. /// <param name="InParam"></param>
  1376. /// <returns></returns>
  1377. public string AgentFun(string InParam)
  1378. {
  1379. Global.writeLog("AgentFun 入参:" + JsonHelper.Compress(InParam));
  1380. //设置返回值,错误信息
  1381. int errCode;
  1382. string errMsg, rtnResult = "", outParam;
  1383. try
  1384. {
  1385. //解析入参
  1386. if (parseInparam(InParam, out errMsg) != 0)
  1387. {
  1388. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  1389. return rtnResult;
  1390. }
  1391. //BS架构调用方式问题,每次调用都需要重新初始化
  1392. if (init(InParam, out outParam) != 0)
  1393. {
  1394. rtnResult = outParam;
  1395. return rtnResult;
  1396. }
  1397. //获取通用目录
  1398. string sTYML = mIS.GetCommonInterface_Dr(Global.inf.interfaceDr.ToString(), "");
  1399. if (sTYML == "")
  1400. Global.inf.interfaceDr_TY = Global.inf.interfaceDr;
  1401. else
  1402. Global.inf.interfaceDr_TY = int.Parse(sTYML);
  1403. //获取pat
  1404. //hBus.GetFeeHisInfo(businessType, joInParam, out Global.pat);
  1405. switch (businessType)
  1406. {
  1407. case "BasicData"://基础数据维护
  1408. {
  1409. BasicData bd = new BasicData();
  1410. if (bd.ShowDialog() != DialogResult.OK)
  1411. {
  1412. rtnResult = JsonHelper.setExceptionJson(-100, "", "已退出基础数据维护界面").ToString();
  1413. return rtnResult;
  1414. }
  1415. break;
  1416. }
  1417. case "Exception"://异常处理
  1418. {
  1419. //显示异常处理界面
  1420. HandleException frmEX = new HandleException();
  1421. if (frmEX.ShowDialog() != DialogResult.OK)
  1422. {
  1423. rtnResult = JsonHelper.setExceptionJson(-100, "", "已退出异常处理界面").ToString();
  1424. return rtnResult;
  1425. }
  1426. break;
  1427. }
  1428. case "CheckAndClearing"://对账清算
  1429. {
  1430. Clearing frmEX = new Clearing();
  1431. if (frmEX.ShowDialog() != DialogResult.OK)
  1432. {
  1433. rtnResult = JsonHelper.setExceptionJson(-100, "", "已退出对账清算界面").ToString();
  1434. return rtnResult;
  1435. }
  1436. break;
  1437. }
  1438. case "Print"://打印
  1439. {
  1440. //显示打印界面
  1441. SettlementBillPrint frmSettlList;
  1442. string insuAdmObj = JsonHelper.getDestValue(joInParam, "insuAdmObj");
  1443. if (insuAdmObj == "")
  1444. {
  1445. frmSettlList = new SettlementBillPrint();
  1446. if (frmSettlList.ShowDialog() != DialogResult.OK)
  1447. {
  1448. rtnResult = JsonHelper.setExceptionJson(-100, "", "已退出打印界面").ToString();
  1449. return rtnResult;
  1450. }
  1451. }
  1452. else
  1453. {
  1454. JObject joInsuAdmObj = JObject.Parse(insuAdmObj);
  1455. frmSettlList = new SettlementBillPrint(joInsuAdmObj);
  1456. string groupID = JsonHelper.getDestValue((JObject)Global.curEvt.jaSession[0], "groupID");
  1457. string userName = JsonHelper.getDestValue((JObject)Global.curEvt.jaSession[0], "userName");
  1458. DataTable dt = (DataTable)frmSettlList.dgvSettlRecord.DataSource;
  1459. int i = frmSettlList.dgvSettlRecord.CurrentRow.Index;
  1460. string AdmID = dt.Rows[i]["AdmID"].ToString();
  1461. string PsnNo = dt.Rows[i]["PersonnelNO"].ToString();
  1462. string MdtrtID = dt.Rows[i]["MdtrtID"].ToString();
  1463. string SettlementID = dt.Rows[i]["SettlementID"].ToString();
  1464. Global.pat.adm_Dr = int.Parse(AdmID);
  1465. if (((groupID == "3") && (dt.Rows.Count > 0)) ||
  1466. (userName == "朱振") || (userName == "朱鹏飞") ||(userName == "陈蒙") ||
  1467. (userName == "张可宁") || (userName == "史绍兴") || (userName == "陈柏全") ||
  1468. (userName == "李翔") || (userName == "王晓兵") || (userName == "史绍兴"))
  1469. {
  1470. //frmSettlList.ShowDialog();
  1471. frmSettlList.btnDesign_Click(null, null);
  1472. }
  1473. else
  1474. {
  1475. JObject joRtnFee = frmSettlList.UpdateMedInsuUploadData(AdmID, PsnNo, MdtrtID, SettlementID);
  1476. frmSettlList.btnPrint_Click(null, null);
  1477. }
  1478. }
  1479. return JsonHelper.setIrisReturnValue(0, "", null).ToString();
  1480. break;
  1481. }
  1482. case "Log"://日志
  1483. {
  1484. MessageBox.Show(businessType);
  1485. break;
  1486. }
  1487. case "RecordUpload"://上传记录
  1488. {
  1489. MessageBox.Show(businessType);
  1490. break;
  1491. }
  1492. case "HospitalRegister"://备案
  1493. {
  1494. ToRecordChoose Referral = new ToRecordChoose();
  1495. if (Referral.ShowDialog() != DialogResult.OK)
  1496. {
  1497. rtnResult = JsonHelper.setExceptionJson(-100, "", "已退出备案信息界面").ToString();
  1498. return rtnResult;
  1499. }
  1500. break;
  1501. }
  1502. case "MedInsuQuery"://医保查询
  1503. {
  1504. MedInsuQuery MedQuery = new MedInsuQuery();
  1505. if (MedQuery.ShowDialog() != DialogResult.OK)
  1506. {
  1507. rtnResult = JsonHelper.setExceptionJson(-100, "", "已退出医保查询界面").ToString();
  1508. return rtnResult;
  1509. }
  1510. break;
  1511. }
  1512. case "PrescribeCirculation"://医保电子处方流转
  1513. {
  1514. //PrescriptionCirculation PresCir = new PrescriptionCirculation();
  1515. PrescriptionCirculation PresCir = new PrescriptionCirculation("");
  1516. if (PresCir.ShowDialog() != DialogResult.OK)
  1517. {
  1518. rtnResult = JsonHelper.setExceptionJson(-100, "", "已退出医保电子处方流转界面").ToString();
  1519. return rtnResult;
  1520. }
  1521. break;
  1522. }
  1523. default:
  1524. {
  1525. rtnResult = JsonHelper.setExceptionJson(-1, "AgentFun 交易", "传入的业务编码不对【"+businessType+"】").ToString();
  1526. return rtnResult;
  1527. }
  1528. }
  1529. return rtnResult;
  1530. }
  1531. catch (Exception ex)
  1532. {
  1533. rtnResult = JsonHelper.setExceptionJson(-1, "AgentFun 交易", ex.Message).ToString();
  1534. return rtnResult;
  1535. }
  1536. finally
  1537. {
  1538. Global.writeLog("AgentFun 出参:" + JsonHelper.Compress(rtnResult));
  1539. }
  1540. }
  1541. public string Download(string InParam)
  1542. {
  1543. Global.writeLog("Download 入参:" + JsonHelper.Compress(InParam));
  1544. //设置返回值,错误信息
  1545. int errCode;
  1546. string errMsg, rtnResult = "", outParam;
  1547. try
  1548. {
  1549. //解析入参
  1550. if (parseInparam(InParam, out errMsg) != 0)
  1551. {
  1552. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  1553. return rtnResult;
  1554. }
  1555. //BS架构调用方式问题,每次调用都需要重新初始化
  1556. if (init(InParam, out outParam) != 0)
  1557. {
  1558. rtnResult = outParam;
  1559. return rtnResult;
  1560. }
  1561. dynamic joData = new JObject();
  1562. joData.data = joParam["data"];
  1563. //string code = (string)joInParam["code"];
  1564. string funNO = (string)joParam["funNO"];
  1565. switch (businessType)
  1566. {
  1567. case "DirectoryDownload":
  1568. {
  1569. string downloadParam = JsonHelper.setCenterInpar(funNO, joData.ToString());
  1570. rtnResult = hBus.DownloadDirectory(funNO, downloadParam).ToString();
  1571. break;
  1572. }
  1573. case "DictionayDownload":
  1574. {
  1575. string downloadParam = JsonHelper.setCenterInpar(funNO, joData.ToString());
  1576. rtnResult = hBus.downDictionary(downloadParam);
  1577. break;
  1578. }
  1579. }
  1580. return rtnResult;
  1581. }
  1582. catch (Exception ex)
  1583. {
  1584. rtnResult = JsonHelper.setExceptionJson(-100, "Download", ex.Message).ToString();
  1585. return rtnResult;
  1586. }
  1587. finally
  1588. {
  1589. Global.writeLog("Download 出参:" + rtnResult);
  1590. }
  1591. }
  1592. public string PlatformDirectConnect(string InParam)
  1593. {
  1594. //设置返回值,错误信息
  1595. int errCode;
  1596. string errMsg, rtnResult = "", outParam;
  1597. try
  1598. {
  1599. Global.writeLog("PlatformDirectConnect 入参:" + JsonHelper.Compress(InParam));
  1600. //解析入参
  1601. if (parseInparam(InParam, out errMsg) != 0)
  1602. {
  1603. rtnResult = JsonHelper.setExceptionJson(-1, "", errMsg).ToString();
  1604. return rtnResult;
  1605. }
  1606. Global.businessType = businessType;
  1607. string funNO = JsonHelper.getDestValue(joInParam, "funNO");
  1608. //BS架构调用方式问题,每次调用都需要重新初始化
  1609. if (init(InParam, out outParam) != 0)
  1610. {
  1611. rtnResult = outParam;
  1612. return rtnResult;
  1613. }
  1614. Global.pat.insuplc_admdvs = JsonHelper.getDestValue(joInParam, "insuplc_admdvs");
  1615. JObject joRtn = invoker.invokeCenterService(funNO, JsonHelper.setCenterInpar(funNO, joParam));
  1616. if (JsonHelper.parseCenterRtnValue(joRtn, out errMsg) != 0)
  1617. {
  1618. rtnResult = JsonHelper.setExceptionJson(-1, "平台直连错误", errMsg).ToString();
  1619. return rtnResult;
  1620. }
  1621. else
  1622. {
  1623. rtnResult = JsonHelper.setIrisReturnValue(0, "", joRtn).ToString();
  1624. return rtnResult;
  1625. }
  1626. }
  1627. catch (Exception ex)
  1628. {
  1629. rtnResult = JsonHelper.setExceptionJson(-1, "PlatformDirectConnect 交易", ex.Message).ToString();
  1630. return rtnResult;
  1631. }
  1632. finally
  1633. {
  1634. Global.writeLog("PlatformDirectConnect 出参:" + JsonHelper.Compress(rtnResult));
  1635. }
  1636. }
  1637. /// <summary>
  1638. /// 自助机
  1639. /// </summary>
  1640. /// <param name="InParam"></param>
  1641. /// <returns></returns>
  1642. public string SelfServiceMachine(string InParam)
  1643. {
  1644. Global.writeLog("SelfServiceMachine 入参:" + JsonHelper.Compress(InParam));
  1645. //设置返回值,错误信息
  1646. string errMsg, rtnResult = "", outParam;
  1647. try
  1648. {
  1649. //解析入参
  1650. if (parseInparam(InParam, out errMsg) != 0)
  1651. {
  1652. rtnResult = JsonHelper.setExceptionJson(-1, "parseInparam", errMsg).ToString();
  1653. return rtnResult;
  1654. }
  1655. //获取pat
  1656. hBus.GetSelfServiceMachineInfo(businessType, joInParam, out Global.pat);
  1657. //BS架构调用方式问题,每次调用都需要重新初始化
  1658. if (init(InParam, out errMsg) != 0)
  1659. //if (hBus.InitA(InParam, out errMsg) != 0)
  1660. {
  1661. rtnResult = JsonHelper.setExceptionJson(-1, "InitA", errMsg).ToString(); ;
  1662. return rtnResult;
  1663. }
  1664. else
  1665. {
  1666. //joInParam.Add("patInfo", errMsg);
  1667. Global.writeLog($"InitA初始化成功!");
  1668. }
  1669. switch (businessType)
  1670. {
  1671. case "GetPatientInfo"://读取患者信息,该节点无需重定向
  1672. {
  1673. //重定向
  1674. Business.Core.SelfServiceMachine.PatientService patientService = new Business.Core.SelfServiceMachine.PatientService();
  1675. rtnResult = patientService.GetPatientInfo();
  1676. break;
  1677. }
  1678. case "OPReg"://门诊挂号
  1679. {
  1680. #region 老版
  1681. //CardReader_GS CardRead_GS = new CardReader_GS();
  1682. //Global.pat.admType = 1;
  1683. //string patInfo = "";
  1684. ////打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息
  1685. //if (hBus.readCard(out outParam) != 0)
  1686. //{
  1687. // rtnResult = JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString();
  1688. // return rtnResult;
  1689. //}
  1690. //else
  1691. //{
  1692. // patInfo = outParam;
  1693. // //展示患者信息界面
  1694. // if (hBus.showPatInfo(patInfo, out outParam) != 0)
  1695. // {
  1696. // rtnResult = outParam;
  1697. // return rtnResult;
  1698. // }
  1699. //}
  1700. ////患者信息赋值给全局变量
  1701. //patInfo = outParam;
  1702. //if (hBus.setGlobalPatAfaterShowPatInfo(patInfo, out errMsg) != 0)
  1703. //{
  1704. // rtnResult = JsonHelper.setExceptionJson(-1, "setGlobalPatAfaterShowPatInfo", errMsg).ToString();
  1705. // return rtnResult;
  1706. //}
  1707. ////校验HIS姓名与医保姓名是否一致
  1708. //if (hBus.checkName(Global.pat.name, out errMsg) != 0)
  1709. //{
  1710. // rtnResult = JsonHelper.setExceptionJson(-1, "校验HIS与医保姓名是否一致", errMsg).ToString();
  1711. // return rtnResult;
  1712. //}
  1713. ////显示登记面板
  1714. //if (hBus.showOutPatRegisterForm(out outParam) != 0)
  1715. //{
  1716. // rtnResult = JsonHelper.setExceptionJson(-1, "显示登记面板", outParam).ToString();
  1717. // return rtnResult;
  1718. //}
  1719. //JObject joReg = JObject.Parse(outParam);
  1720. ////医保挂号
  1721. //JObject jo2201Inpar = JObject.Parse(JsonHelper.getDestProperty(joReg, "data"));
  1722. //JObject jo2201Inpar_plain = JObject.Parse(JsonHelper.getDestProperty(joReg, "data"));
  1723. //jo2201Inpar = JObject.Parse(JsonHelper.setCenterInpar("2201", jo2201Inpar));
  1724. //jo2201Inpar_plain = JObject.Parse(JsonHelper.setCenterInpar_plain("2201", jo2201Inpar_plain));
  1725. ////此处先取到就诊信息上传的入参,只要挂号成功就保存到云HIS后台(保存后台需要用到2203入参)
  1726. //JObject jo2203Inpar = new JObject();
  1727. //JObject jo2203Inpar_plain = new JObject();
  1728. //jo2203Inpar.Add("mdtrtinfo", JObject.Parse(JsonHelper.getDestValue(joReg, "mdtrtinfo")));
  1729. //jo2203Inpar.Add("diseinfo", JArray.Parse(JsonHelper.getDestValue(joReg, "diseinfo")));
  1730. //JObject jo2201Rtn = invoker.invokeCenterService("2201", jo2201Inpar);
  1731. //if (JsonHelper.parseCenterRtnValue(jo2201Rtn, out errMsg) != 0)
  1732. //{
  1733. // rtnResult = JsonHelper.setExceptionJson(-1, "医保挂号", errMsg).ToString();
  1734. // return rtnResult;
  1735. //}
  1736. //else
  1737. //{
  1738. // Global.pat.mdtrtID = JsonHelper.getDestValue(jo2201Rtn, "output.data.mdtrt_id");
  1739. // //插入患者本次就诊用的参保信息
  1740. // if (hBus.insertPatCurInsuInfo(patInfo, out outParam) != 0)
  1741. // {
  1742. // if (DialogResult.Yes != MessageBox.Show(outParam, " 是否继续? ", MessageBoxButtons.YesNo))
  1743. // {
  1744. // rtnResult = JsonHelper.setExceptionJson(-1, "插入患者本次就诊用的参保信息,请联系管理员!是否继续?", outParam).ToString();
  1745. // return rtnResult;
  1746. // }
  1747. // }
  1748. // jo2203Inpar["mdtrtinfo"]["mdtrt_id"] = Global.pat.mdtrtID;
  1749. // jo2203Inpar_plain = JObject.Parse(JsonHelper.setCenterInpar_plain("2203", jo2203Inpar));
  1750. // jo2203Inpar = JObject.Parse(JsonHelper.setCenterInpar("2203", jo2203Inpar));
  1751. // //门诊登记信息,插入云医保平台
  1752. // jo2201Rtn.Add("validflag", 1);
  1753. // jo2201Rtn.Add("regstate", 1);
  1754. // jo2201Rtn.Add("type", 3);
  1755. // Global.writeLog(jo2201Inpar_plain.ToString());
  1756. // if (mIS.saveOutpatRegisterInfo(jo2201Inpar_plain, jo2201Rtn, jo2203Inpar_plain, out errMsg) != 0)
  1757. // {
  1758. // rtnResult = JsonHelper.setExceptionJson(-1, "中心登记成功但医保平台保存失败,请联系管理员!", errMsg).ToString();
  1759. // return rtnResult;
  1760. // }
  1761. //}
  1762. ////门诊就诊信息上传
  1763. //JObject jo2203Rtn = invoker.invokeCenterService("2203", jo2203Inpar);
  1764. //if (JsonHelper.parseCenterRtnValue(jo2203Rtn, out errMsg) != 0)
  1765. //{
  1766. // rtnResult = JsonHelper.setExceptionJson(-1, "门诊就诊信息上传", errMsg).ToString();
  1767. // return rtnResult;
  1768. //}
  1769. //#region【门诊就诊信息上传成功后调用3101事前服务】
  1770. ////1.获取3101入参报文
  1771. //if (Global.curEvt.ext.isOpenAnalysis)
  1772. //{
  1773. // if (hIS.GetInsuPatInfo("1", Global.pat, out outParam) != 0)
  1774. // {
  1775. // rtnResult = JsonHelper.setExceptionJson(-1, "获取3101医保明细审核事前分析服务入参失败:", outParam).ToString();
  1776. // return rtnResult;
  1777. // }
  1778. // else
  1779. // {
  1780. // //2.调用医保3101明细审核事前分析服务
  1781. // JObject joInput = new JObject();
  1782. // //joInput.Add("data", JObject.Parse(outParam));
  1783. // joInput = JObject.Parse(outParam);
  1784. // JObject jo3101Rtn = invoker.invokeCenterService("3101", JsonHelper.setCenterInpar("3101", joInput.ToString().Replace("\r\n", ""))); //.Replace(" ", "")
  1785. // if (JsonHelper.parseCenterRtnValue(jo3101Rtn, out errMsg) != 0)
  1786. // {
  1787. // rtnResult = JsonHelper.setExceptionJson(-1, "【3101】医保明细审核事前分析服务调用失败:", errMsg).ToString();
  1788. // return rtnResult;
  1789. // }
  1790. // else
  1791. // {
  1792. // JArray jaResult = JArray.Parse(JsonHelper.getDestValue(jo3101Rtn, "output.result"));
  1793. // if (jaResult.HasValues)
  1794. // {
  1795. // PreAndInProcessAnalysisForm paipaForm = new PreAndInProcessAnalysisForm(jo3101Rtn);
  1796. // if (paipaForm.ShowDialog() != DialogResult.OK)
  1797. // {
  1798. // errMsg = "事前事中审核不通过,操作员取消!";
  1799. // rtnResult = JsonHelper.setExceptionJson(-1, "【3101】医保明细审核事前分析服务调用失败:", errMsg).ToString();
  1800. // return rtnResult;
  1801. // }
  1802. // }
  1803. // }
  1804. // }
  1805. //}
  1806. //#endregion
  1807. ////费用上传
  1808. //if (hBus.uploadFee("2204", 50, out outParam) != 0)
  1809. //{
  1810. // rtnResult = JsonHelper.setExceptionJson(-1, "费用上传", outParam).ToString();
  1811. // return rtnResult;
  1812. //}
  1813. //#region【门诊预结算2206前调用3102医保明细审核事中服务】
  1814. //if (Global.curEvt.ext.isOpenAnalysis)
  1815. //{
  1816. // //1.获取3102入参报文
  1817. // if (hIS.GetInsuPatInfo("2", Global.pat, out outParam) != 0)
  1818. // {
  1819. // rtnResult = JsonHelper.setExceptionJson(-1, "获取3102医保明细审核事中分析服务入参失败:", outParam).ToString();
  1820. // return rtnResult;
  1821. // }
  1822. // else
  1823. // {
  1824. // //2.调用医保3102明细审核事前分析服务
  1825. // JObject joInput = new JObject();
  1826. // //joInput.Add("data", JObject.Parse(outParam));
  1827. // joInput = JObject.Parse(outParam);
  1828. // JObject jo3102Rtn = invoker.invokeCenterService("3102", JsonHelper.setCenterInpar("3102", joInput.ToString().Replace("\r\n", "")));
  1829. // if (JsonHelper.parseCenterRtnValue(jo3102Rtn, out errMsg) != 0)
  1830. // {
  1831. // rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
  1832. // return rtnResult;
  1833. // }
  1834. // else
  1835. // {
  1836. // JArray jaResult = JArray.Parse(JsonHelper.getDestValue(jo3102Rtn, "output.result"));
  1837. // if (jaResult.HasValues)
  1838. // {
  1839. // PreAndInProcessAnalysisForm paipaForm = new PreAndInProcessAnalysisForm(jo3102Rtn);
  1840. // if (paipaForm.ShowDialog() != DialogResult.OK)
  1841. // {
  1842. // errMsg = "事前事中审核不通过,操作员取消!";
  1843. // rtnResult = JsonHelper.setExceptionJson(-1, "【3102】医保明细审核事中分析服务调用失败:", errMsg).ToString();
  1844. // return rtnResult;
  1845. // }
  1846. // }
  1847. // }
  1848. // }
  1849. //}
  1850. //#endregion
  1851. ////调用IRIS获取医保各项金额
  1852. //if (mIS.getSumFee(out outParam) != 0)
  1853. //{
  1854. // rtnResult = JsonHelper.setExceptionJson(-1, "获取医保费用各项汇总金额", outParam).ToString();
  1855. // return rtnResult;
  1856. //}
  1857. //JObject joSumFee = JObject.Parse(outParam);
  1858. //JObject joSettlement = JObject.Parse(JsonHelper.getDestValue(joReg, "settlement"));
  1859. ////修改joSettlement的就诊ID ,总金额等
  1860. //joSettlement["mdtrt_id"] = Global.pat.mdtrtID;
  1861. //joSettlement["medfee_sumamt"] = JsonHelper.getDestValue(joSumFee, "data.Sumamt");
  1862. ////预结算2206
  1863. //if (hBus.preSettlement_OutPat(joSettlement, out outParam) != 0)
  1864. //{
  1865. // rtnResult = JsonHelper.setExceptionJson(-1, "结算信息展示", outParam).ToString();
  1866. // return rtnResult;
  1867. //}
  1868. //#region【门诊正式结算前调用社保卡验密】
  1869. //if ((Global.pat.mdtrtcertType == "03") && (Global.pat.insuplc_admdvs.Substring(0, 2) == "62"))
  1870. //{
  1871. // if (CardRead_GS.VerifyPIN(out outParam) != 0)
  1872. // {
  1873. // rtnResult = JsonHelper.setExceptionJson(-1, "社保卡验密异常iVerifyPIN失败 ", outParam).ToString();
  1874. // return rtnResult;
  1875. // }
  1876. //}
  1877. //#endregion
  1878. ////正式结算
  1879. //JObject joData = new JObject();
  1880. //joData.Add("data", joSettlement);
  1881. //JObject joRtn = invoker.invokeCenterService("2207", JsonHelper.setCenterInpar("2207", joData));
  1882. //if (JsonHelper.parseCenterRtnValue(joRtn, out errMsg) != 0)
  1883. //{
  1884. // rtnResult = JsonHelper.setExceptionJson(-1, "结算失败", errMsg).ToString();
  1885. // return rtnResult;
  1886. //}
  1887. //else
  1888. //{
  1889. // //返回给云医保平台结算信息
  1890. // if (mIS.saveSettlement(joRtn, out errMsg) != 0)
  1891. // {
  1892. // rtnResult = JsonHelper.setExceptionJson(-1, "结算成功,但云医保平台保存失败", errMsg).ToString();
  1893. // return rtnResult;
  1894. // }
  1895. // //返回给云医保平台结算明细信息
  1896. // if (mIS.saveSettlementDetail(joRtn, out errMsg) != 0)
  1897. // {
  1898. // rtnResult = JsonHelper.setExceptionJson(-1, "云医保平台保存结算明细失败", errMsg).ToString();
  1899. // return rtnResult;
  1900. // }
  1901. // //返回给HIS
  1902. // JObject joSetlinfo = JObject.Parse(JsonHelper.getDestValue(joRtn, "output.setlinfo"));
  1903. // if (hIS.returnOutpatSettlementInfo(joSettlement, joSetlinfo, out outParam) != 0)
  1904. // {
  1905. // rtnResult = JsonHelper.setExceptionJson(-1, "返回结算信息给HIS", outParam).ToString();
  1906. // return rtnResult;
  1907. // }
  1908. // else
  1909. // {
  1910. // JObject joHisServieRtn = JObject.Parse(outParam);
  1911. // hBus.returnToFrontEndAfterSettlement(joRtn, joHisServieRtn, out outParam);
  1912. // rtnResult = JsonHelper.setIrisReturnValue(0, "结算成功", JObject.Parse(outParam)).ToString();
  1913. // return rtnResult;
  1914. // }
  1915. //}
  1916. #endregion
  1917. #region 链条式任务调度者
  1918. OPRegService service = new OPRegService();
  1919. rtnResult = service.Charge(operationType, joInParam);
  1920. break;
  1921. #endregion
  1922. }
  1923. case "OPSettl"://门诊结算
  1924. {
  1925. OPSettlementService service = new OPSettlementService();
  1926. rtnResult = service.Charge(operationType, joInParam);
  1927. break;
  1928. }
  1929. case "IPInReg"://入院登记
  1930. {
  1931. IPAdmRegService service = new IPAdmRegService();
  1932. rtnResult = service.Register(operationType, joInParam);
  1933. break;
  1934. }
  1935. case "IPInRegCancel"://取消入院登记
  1936. {
  1937. IPAdmRegService service = new IPAdmRegService();
  1938. rtnResult = service.CancelRegister(operationType, joInParam);
  1939. break;
  1940. }
  1941. case "IPOutReg"://出院登记
  1942. {
  1943. break;
  1944. }
  1945. case "IPUpoload"://住院费用上传
  1946. {
  1947. break;
  1948. }
  1949. case "IPPreSettl"://住院预计结算
  1950. {
  1951. break;
  1952. }
  1953. case "IPSettl"://住院结算
  1954. {
  1955. IPSettlementService service = new IPSettlementService();
  1956. rtnResult = service.Charge(joInParam);
  1957. return rtnResult;
  1958. }
  1959. case "DischargeAudit"://费用核查
  1960. {
  1961. DischargeAuditService service = new DischargeAuditService();
  1962. rtnResult = service.Audit(joInParam);
  1963. return rtnResult;
  1964. }
  1965. default:
  1966. {
  1967. rtnResult = JsonHelper.setExceptionJson(-1, "SelfServiceMachine 交易", "传入的业务编码不对!").ToString();
  1968. return rtnResult;
  1969. }
  1970. }
  1971. return rtnResult;
  1972. }
  1973. catch (Exception ex)
  1974. {
  1975. rtnResult = JsonHelper.setExceptionJson(-1, "SelfServiceMachine 交易", ex.Message).ToString();
  1976. return rtnResult;
  1977. }
  1978. finally
  1979. {
  1980. Global.writeLog("SelfServiceMachine 出参:" + JsonHelper.Compress(rtnResult));
  1981. }
  1982. }
  1983. }
  1984. }