IrisServices.cs 107 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571
  1. /******************************************************************************
  2. * 文件名称: CardReader.cs
  3. * 文件说明: 读卡的封装,包括社保卡,身份证,电子凭证等等
  4. * 当前版本: V1.0
  5. * 创建日期: 2022-06-25
  6. *
  7. * * 2020-06-20: 增加 IrisServices 类(基类)
  8. * ***** 2020-06-25: 增加 CardReader 方法,获取URL地址,USER信息,地方版SSCard.dll使用
  9. * ***** 2020-06-25: 增加 CardReader 方法重载,国家版电子凭证使用
  10. *
  11. *
  12. * * 2020-06-20: 增加 HisIrisServices 类(子类)
  13. * ***** 2020-06-25: 增加 CardReader 方法,获取URL地址,USER信息,地方版SSCard.dll使用
  14. * ***** 2020-06-25: 增加 CardReader 方法重载,国家版电子凭证使用
  15. *
  16. *
  17. * * 2020-06-20: 增加 MIIrisServices 类(子类)
  18. * ***** 2020-06-25: 增加 CardReader 方法,获取URL地址,USER信息,地方版SSCard.dll使用
  19. * ***** 2020-06-25: 增加 CardReader 方法重载,国家版电子凭证使用
  20. ******************************************************************************/
  21. using Newtonsoft.Json.Linq;
  22. using System;
  23. using System.Collections.Generic;
  24. using System.Linq;
  25. using System.Text;
  26. using System.Threading.Tasks;
  27. using PTMedicalInsurance.Variables;
  28. using PTMedicalInsurance.Helper;
  29. using System.Windows.Forms;
  30. namespace PTMedicalInsurance.Business
  31. {
  32. class IrisServices
  33. {
  34. }
  35. class HisIrisServices
  36. {
  37. private InvokeHelper invoker = new InvokeHelper();
  38. /// <summary>
  39. /// 获取医院用户信息
  40. /// </summary>
  41. /// <param name="UserID"></param>
  42. /// <returns></returns>
  43. public JObject GetHosUserInfo(string UserID)
  44. {
  45. try
  46. {
  47. JObject joInput = new JObject();
  48. joInput.Add("hospID", Global.inf.hisHospitalDr);
  49. joInput.Add("userID", UserID);
  50. string inpar = JsonHelper.setIrisInpar("01040297", joInput).ToString();
  51. JObject joRtn = invoker.invokeHISService(inpar, "获取医院用户信息");
  52. return joRtn;
  53. }
  54. catch (Exception ex)
  55. {
  56. return JsonHelper.setExceptionJson(-1, "获取医院用户信息异常:", ex.Message);
  57. }
  58. }
  59. /// <summary>
  60. /// 获取患者基本信息
  61. /// </summary>
  62. /// <param name="errMsg"></param>
  63. /// <returns></returns>
  64. public int GetHisPatBaseInfo(out string errMsg)
  65. {
  66. errMsg = "";
  67. try
  68. {
  69. dynamic joTmp = new JObject();
  70. joTmp.admID = Global.pat.adm_Dr;
  71. JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110021", joTmp).ToString(), "获取HIS患者基本信息");
  72. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  73. {
  74. errMsg = "获取HIS患者基本信息失败,请联系管理员!" + errMsg;
  75. return -1;
  76. }
  77. else
  78. {
  79. errMsg = joRtn.ToString();
  80. return 0;
  81. }
  82. }
  83. catch (Exception ex)
  84. {
  85. errMsg = "GetHisPatBaseInfo异常:" + ex.Message;
  86. return -1;
  87. }
  88. }
  89. /// <summary>
  90. /// 获取HIS就诊信息
  91. /// </summary>
  92. /// <param name="joParam"></param>
  93. /// <param name="outParam"></param>
  94. /// <returns></returns>
  95. public JObject GetHISRegInfo(JObject joParam)
  96. {
  97. //string errMsg;
  98. try
  99. {
  100. string serviceCode = "09030048";
  101. string inpar = JsonHelper.setIrisInpar(serviceCode, joParam).ToString();
  102. JObject joRtn = invoker.invokeHISService(inpar, "获取HIS就诊信息");
  103. return joRtn;
  104. }
  105. catch (Exception ex)
  106. {
  107. return JsonHelper.setExceptionJson(-1, "获取HIS就诊信息异常:", ex.Message);
  108. }
  109. }
  110. /// <summary>
  111. /// 获取HIS处方明细信息
  112. /// </summary>
  113. /// <param name="joParam"></param>
  114. /// <param name="outParam"></param>
  115. /// <returns></returns>
  116. public JObject GetHISPrescFeeInfo(JObject joParam)
  117. {
  118. //string errMsg;
  119. try
  120. {
  121. string serviceCode = "09030049";
  122. string inpar = JsonHelper.setIrisInpar(serviceCode, joParam).ToString();
  123. JObject joRtn = invoker.invokeHISService(inpar, "获取HIS处方信息");
  124. return joRtn;
  125. }
  126. catch (Exception ex)
  127. {
  128. return JsonHelper.setExceptionJson(-1, "获取HIS处方信息异常:", ex.Message);
  129. }
  130. }
  131. /// <summary>
  132. /// 获取HIS处方明细信息
  133. /// </summary>
  134. /// <param name="joParam"></param>
  135. /// <param name="outParam"></param>
  136. /// <returns></returns>
  137. public JObject GetPreVerificationData(JObject joParam)
  138. {
  139. //string errMsg;
  140. try
  141. {
  142. string serviceCode = "09030050";
  143. string inpar = JsonHelper.setIrisInpar(serviceCode, joParam).ToString();
  144. JObject joRtn = invoker.invokeHISService(inpar, "组织处方预核验数据");
  145. return joRtn;
  146. }
  147. catch (Exception ex)
  148. {
  149. return JsonHelper.setExceptionJson(-1, "组织处方预核验数据异常:", ex.Message);
  150. }
  151. }
  152. /// <summary>
  153. /// 电子处方PDF生成Base64Str
  154. /// </summary>
  155. /// <param name="PDFName">文件名</param>
  156. /// <param name="PresNo">HIS处方号</param>
  157. /// <param name="HospID">医院ID</param>
  158. /// <param name="OutMsg">返回值</param>
  159. /// <returns></returns>
  160. public int GetPrescPDFBase64Str(string PDFName, string PresNo, string HospID, out string OutMsg)
  161. {
  162. //string errMsg;
  163. try
  164. {
  165. JObject joTmp = new JObject();
  166. joTmp.Add("pdfName", PDFName);
  167. joTmp.Add("ordPrescNo", PresNo);
  168. joTmp.Add("hospID", HospID);
  169. string inpar = JsonHelper.setIrisInpar("09030055", joTmp).ToString();
  170. JObject joRtn = invoker.invokeHISService(inpar, "电子处方PDF生成Base64Str");
  171. if (JsonHelper.parseIrisRtnValue(joRtn, out string errMsg) != 0)
  172. {
  173. OutMsg = "获取电子处方PDF生成Base64Str失败,请联系管理员!" + errMsg;
  174. return -1;
  175. }
  176. else
  177. {
  178. if (JsonHelper.getDestValue(joRtn, "result") == "")
  179. {
  180. OutMsg = "获取电子处方PDF生成Base64Str失败,请联系管理员" + errMsg;
  181. return -1;
  182. }
  183. OutMsg = joRtn.ToString();
  184. return 0;
  185. }
  186. }
  187. catch (Exception ex)
  188. {
  189. OutMsg = "电子处方PDF生成Base64Str异常:" + ex.Message;
  190. //OutMsg = JsonHelper.setExceptionJson(-1, "电子处方PDF生成Base64Str异常:", ex.Message).ToString();
  191. return -1;
  192. }
  193. }
  194. /// <summary>
  195. /// 电子处方上传成功后更新HIS处方状态
  196. /// </summary>
  197. /// <param name="HISPrecNo"></param>
  198. /// <param name="INSUPrecNo"></param>
  199. /// <param name="status">C:撤销 上传:U</param>
  200. public int updateHISPrecNoStatus(string HISPrecNo, string INSUPrecNo, string status, out string OutMsg)
  201. {
  202. try
  203. {
  204. JObject joTmp = new JObject();
  205. joTmp.Add("HISPrecNo", HISPrecNo);
  206. joTmp.Add("INSUPrecNo", INSUPrecNo);
  207. joTmp.Add("status", status);
  208. joTmp.Add("businessCode", "prescUpload");
  209. string inpar = JsonHelper.setIrisInpar("09030033", joTmp).ToString();
  210. JObject joRtn = invoker.invokeHISService(inpar, "电子处方上传成功后更新HIS处方状态");
  211. if (JsonHelper.parseIrisRtnValue(joRtn, out string errMsg) != 0)
  212. {
  213. OutMsg = "医保电子处方上传成功后更新HIS处方状态失败,请联系管理员!" + errMsg;
  214. return -1;
  215. }
  216. else
  217. {
  218. if (JsonHelper.getDestValue(joRtn, "result") == "")
  219. {
  220. OutMsg = "电子处方上传成功后更新HIS处方状态,请联系管理员" + errMsg;
  221. return -1;
  222. }
  223. OutMsg = joRtn.ToString();
  224. return 0;
  225. }
  226. }
  227. catch (Exception ex)
  228. {
  229. OutMsg = "电子处方上传成功后更新HIS处方状态:" + ex.Message;
  230. return -1;
  231. }
  232. }
  233. /// <summary>
  234. /// 获取诊断信息
  235. /// </summary>
  236. /// <param name="jaSession"></param>
  237. /// <param name="diagnoses"></param>
  238. /// <returns></returns>
  239. public int getPatDiagnoses(Patients pat, out string outParam)
  240. {
  241. outParam = "";
  242. string errMsg;
  243. try
  244. {
  245. JObject joTmp = new JObject();
  246. joTmp.Add("admID", pat.adm_Dr);
  247. joTmp.Add("psn_no", pat.psn_no);
  248. //JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110001", joTmp).ToString(), "获取诊断信息");
  249. JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110014", joTmp).ToString(), "获取诊断信息");
  250. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  251. {
  252. outParam = "获取诊断信息失败,请联系管理员!" + errMsg;
  253. return -1;
  254. }
  255. else
  256. {
  257. outParam = joRtn.ToString();
  258. return 0;
  259. }
  260. }
  261. catch (Exception ex)
  262. {
  263. outParam = "getPatDiagnoses 异常:" + ex.Message;
  264. return -1;
  265. }
  266. }
  267. /// <summary>
  268. /// 返回登记信息给HIS
  269. /// </summary>
  270. /// <param name="joRegIn"></param>
  271. /// <param name="joRegOut"></param>
  272. /// <param name="outParam"></param>
  273. /// <returns></returns>
  274. public int returnRegisterInfo(JObject joRegIn, JObject joRegOut, out string outParam)
  275. {
  276. string errMsg;
  277. try
  278. {
  279. JObject joSendToIris2401 = joRegIn;
  280. joSendToIris2401.Add("admID", Global.pat.adm_Dr);
  281. joSendToIris2401.Add("mdtrt_id", JsonHelper.getDestValue(joRegOut, "output.result.mdtrt_id"));
  282. joSendToIris2401.Add("interfaceDr", Global.inf.interfaceDr);
  283. joSendToIris2401.Add("billID", Global.pat.billID);
  284. string serviceCode = "05110002", serviceName = "将登记信息返回给HIS";
  285. string inpar = JsonHelper.setIrisInpar(serviceCode, joRegIn).ToString();
  286. JObject joRtn = invoker.invokeHISService(inpar,serviceName);
  287. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  288. {
  289. outParam = "中心登记成功但云HIS平台保存失败,请联系管理员!" + errMsg;
  290. return -1;
  291. }
  292. else
  293. {
  294. outParam = "返回给HIS成功";
  295. return 0;
  296. }
  297. }
  298. catch (Exception ex )
  299. {
  300. outParam = "HIS保存登记信息出现异常:!" + ex.Message;
  301. return -1;
  302. }
  303. }
  304. /// <summary>
  305. /// 门诊返回登记信息给HIS
  306. /// </summary>
  307. /// <param name="joRegIn"></param>
  308. /// <param name="joRegOut"></param>
  309. /// <param name="outParam"></param>
  310. /// <returns></returns>
  311. public int returnRegisterInfo(JObject joRegIn, string mdtrtID, out string outParam)
  312. {
  313. string errMsg;
  314. try
  315. {
  316. JObject joSendToIris2401 = joRegIn;
  317. joSendToIris2401.Add("admID", Global.pat.adm_Dr);
  318. joSendToIris2401.Add("mdtrt_id", mdtrtID);
  319. joSendToIris2401.Add("interfaceDr", Global.inf.interfaceDr);
  320. joSendToIris2401.Add("billID", Global.pat.billID);
  321. joSendToIris2401.Add("insutype", Global.pat.insuType);
  322. string serviceCode = "05110002", serviceName = "将门诊登记信息返回给HIS";
  323. string inpar = JsonHelper.setIrisInpar(serviceCode, joRegIn).ToString();
  324. JObject joRtn = invoker.invokeHISService(inpar, serviceName);
  325. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  326. {
  327. outParam = "中心登记成功但云HIS平台保存失败,请联系管理员!" + errMsg;
  328. return -1;
  329. }
  330. else
  331. {
  332. outParam = "返回给HIS成功";
  333. return 0;
  334. }
  335. }
  336. catch (Exception ex)
  337. {
  338. outParam = "HIS保存登记信息出现异常:!" + ex.Message;
  339. return -1;
  340. }
  341. }
  342. /// <summary>
  343. /// 获取His费用
  344. /// </summary>
  345. /// <param name="pat"></param>
  346. /// <param name="errMsg"></param>
  347. /// <returns></returns>
  348. public int getHisFee(Patients pat, out string outParam)
  349. {
  350. outParam = "";
  351. string errMsg;
  352. try
  353. {
  354. dynamic joIrisParam = new JObject();
  355. JArray jaIrisParams = new JArray();
  356. JObject joIrisTmp = new JObject();
  357. joIrisParam.code = "05110003";
  358. joIrisParam.session = Global.curEvt.jaSession;
  359. joIrisTmp.Add("admID", pat.adm_Dr);
  360. joIrisTmp.Add("billID", pat.billID);
  361. joIrisTmp.Add("recordID", pat.recordID);
  362. jaIrisParams.Add(joIrisTmp);
  363. joIrisParam.Add("params", JArray.FromObject(jaIrisParams));
  364. JObject joRtn = invoker.invokeHISService(joIrisParam.ToString(), "获取HIS费用");
  365. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  366. {
  367. outParam = errMsg;
  368. return -1;
  369. }
  370. else
  371. {
  372. outParam = joRtn.ToString();
  373. return 0;
  374. }
  375. }
  376. catch (Exception ex)
  377. {
  378. outParam = "deleteFee 异常:" + ex.Message;
  379. return -1;
  380. }
  381. }
  382. /// <summary>
  383. /// 取消登记信息
  384. /// </summary>
  385. /// <param name="outParam"></param>
  386. /// <returns></returns>
  387. public int cancleRegister( out string outParam)
  388. {
  389. outParam = "";
  390. string errMsg;
  391. try
  392. {
  393. dynamic joTmp = new JObject();
  394. joTmp.Add("admID", Global.pat.adm_Dr);
  395. joTmp.Add("interfaceDr", Global.inf.interfaceDr);
  396. joTmp.Add("billID", Global.pat.billID);
  397. string serviceCode = "05110004";
  398. string inpar = JsonHelper.setIrisInpar(serviceCode, joTmp).ToString();
  399. JObject joRtn = invoker.invokeHISService(inpar, "取消HIS登记信息");
  400. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  401. {
  402. outParam = joRtn.ToString();
  403. return -1;
  404. }
  405. else
  406. {
  407. outParam = joRtn.ToString();
  408. return 0;
  409. }
  410. }
  411. catch (Exception ex)
  412. {
  413. outParam = "取消登记异常" + ":" + ex.Message;
  414. return -1;
  415. }
  416. }
  417. /// <summary>
  418. /// HIS预结算
  419. /// </summary>
  420. /// <param name="joParam"></param>
  421. /// <param name="joSetlinfo"></param>
  422. /// <param name="outParam"></param>
  423. /// <returns></returns>
  424. public int preSettlementInfo(JObject joParam, JObject joSetlinfo, out string outParam)
  425. {
  426. string errMsg;
  427. try
  428. {
  429. dynamic joTmp = new JObject();
  430. joTmp = joParam.DeepClone();
  431. joTmp.insuPayInfo = joSetlinfo;
  432. joTmp.updateUserID = Global.user.ID;
  433. joTmp.middleSettleFlag = "";
  434. JObject joSumFee = new JObject();
  435. if (sumInsuRtnSettlInfo(joSetlinfo, out joSumFee, out errMsg) != 0)
  436. {
  437. outParam = "汇总结算结果失败,请联系管理员!" + errMsg;
  438. return -1;
  439. }
  440. joTmp.sumFeeObj = joSumFee;
  441. JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110020", joTmp).ToString(), "返回2303结算结果给HIS");
  442. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  443. {
  444. outParam = "返回2303结算结果给HIS失败,请联系管理员!" + errMsg;
  445. return -1;
  446. }
  447. else
  448. {
  449. outParam = joRtn.ToString();
  450. return 0;
  451. }
  452. }
  453. catch (Exception ex)
  454. {
  455. outParam = "返回2303结算结果给HIS出现异常:!" + ex.Message;
  456. return -1;
  457. }
  458. }
  459. //public int preSettlementInfo(JObject joParam, JObject joSetlinfo, out string outParam)
  460. //{
  461. // string errMsg;
  462. // try
  463. // {
  464. // dynamic joTmp = new JObject();
  465. // joTmp = joParam.DeepClone();
  466. // joTmp.insuPayInfo = joSetlinfo;
  467. // joTmp.updateUserID = Global.user.ID;
  468. // joTmp.middleSettleFlag = "";
  469. // JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110011", joTmp).ToString(), "返回2304结算结果给HIS");
  470. // if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  471. // {
  472. // outParam = "返回2303结算结果给HIS失败,请联系管理员!" + errMsg;
  473. // return -1;
  474. // }
  475. // else
  476. // {
  477. // outParam = joRtn.ToString();
  478. // return 0;
  479. // }
  480. // }
  481. // catch (Exception ex)
  482. // {
  483. // outParam = "返回2303结算结果给HIS出现异常:!" + ex.Message;
  484. // return -1;
  485. // }
  486. //}
  487. /// <summary>
  488. /// 返回住院结算信息给HIS
  489. /// </summary>
  490. /// <param name="joParam"></param>
  491. /// <param name="joSetlinfo"></param>
  492. /// <param name="outParam"></param>
  493. /// <returns></returns>
  494. public int returnInpatSettlementInfo(JObject joParam, JObject joSetlinfo, out string outParam)
  495. {
  496. string errMsg;
  497. try
  498. {
  499. dynamic joTmp = new JObject();
  500. joTmp = joParam.DeepClone();
  501. joTmp.insuPayInfo = joSetlinfo;
  502. joTmp.updateUserID = Global.user.ID;
  503. joTmp.middleSettleFlag = "";
  504. JObject joSumFee = new JObject();
  505. if (sumInsuRtnSettlInfo(joSetlinfo, out joSumFee, out errMsg) != 0)
  506. {
  507. outParam = "汇总结算结果失败,请联系管理员!" + errMsg;
  508. return -1;
  509. }
  510. joTmp.sumFeeObj = joSumFee;
  511. //JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110007", joTmp).ToString(), "返回2304结算结果给HIS");
  512. JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110017", joTmp).ToString(), "返回2304结算结果给HIS");
  513. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  514. {
  515. outParam = "返回2304结算结果给HIS失败,请联系管理员!" + errMsg;
  516. return -1;
  517. }
  518. else
  519. {
  520. outParam = joRtn.ToString();
  521. return 0;
  522. }
  523. }
  524. catch (Exception ex)
  525. {
  526. outParam = "返回2304结算结果给HIS出现异常:!" + ex.Message;
  527. return -1;
  528. }
  529. }
  530. /// <summary>
  531. /// 预结算后返回门诊结算信息给HIS,HIS进行预结算
  532. /// </summary>
  533. /// <param name="joSetlInpar"></param>
  534. /// <param name="joSetlinfo"></param>
  535. /// <param name="outParam"></param>
  536. /// <returns></returns>
  537. public int preSettlement(JObject joSetlInpar, JObject joSetlinfo, out string outParam)
  538. {
  539. string errMsg;
  540. try
  541. {
  542. JObject joSumFee = new JObject();
  543. if (sumInsuRtnSettlInfo(joSetlinfo, out joSumFee, out errMsg) != 0)
  544. {
  545. outParam = "汇总结算结果失败,请联系管理员!" + errMsg;
  546. return -1;
  547. }
  548. dynamic joTmp = new JObject();
  549. joTmp.settleInfo = joSetlinfo;
  550. joTmp.updateUserID = Global.user.ID;
  551. joTmp.regInfo = joSetlInpar;
  552. joTmp.middleSettleFlag = "";
  553. joTmp.interfaceDr = Global.inf.interfaceDr;
  554. dynamic joHisInfo = new JObject();
  555. joHisInfo.admID = Global.pat.adm_Dr;
  556. joHisInfo.billID = Global.pat.billID;
  557. joHisInfo.recordID = Global.pat.recordID;
  558. joTmp.hisInfo = joHisInfo;
  559. joTmp.psn_type = Global.pat.psn_type;
  560. joTmp.sumFeeObj = joSumFee;
  561. JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110019", joTmp).ToString(), "返回2206结算结果给HIS进行预结算");
  562. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  563. {
  564. outParam = "返回2206结算结果给HIS进行预结算失败,请联系管理员!" + errMsg;
  565. return -1;
  566. }
  567. else
  568. {
  569. outParam = joRtn.ToString();
  570. return 0;
  571. }
  572. }
  573. catch (Exception ex)
  574. {
  575. outParam = "返回2206结算结果给HIS进行预结算异常!" + ex.Message;
  576. return -1;
  577. }
  578. }
  579. /// <summary>
  580. /// 返回门诊结算信息给HIS
  581. /// </summary>
  582. /// <param name="joSetlInpar"></param>
  583. /// <param name="joSetlinfo"></param>
  584. /// <param name="outParam"></param>
  585. /// <returns></returns>
  586. public int returnOutpatSettlementInfo(JObject joSetlInpar, JObject joSetlinfo, out string outParam)
  587. {
  588. string errMsg;
  589. try
  590. {
  591. JObject joSumFee = new JObject();
  592. if (sumInsuRtnSettlInfo(joSetlinfo, out joSumFee, out errMsg) != 0)
  593. {
  594. outParam = "返回2207结算结果给HIS失败,请联系管理员!";
  595. return -1;
  596. }
  597. dynamic joTmp = new JObject();
  598. joTmp.settleInfo = joSetlinfo;
  599. joTmp.updateUserID = Global.user.ID;
  600. joTmp.regInfo = joSetlInpar;
  601. joTmp.middleSettleFlag = "";
  602. joTmp.interfaceDr = Global.inf.interfaceDr;
  603. joTmp.insuplc_admdvs = Global.pat.insuplc_admdvs; //此处增加参保地入参 HIS医保登记表插入
  604. dynamic joHisInfo = new JObject();
  605. joHisInfo.admID = Global.pat.adm_Dr;
  606. joHisInfo.billID = Global.pat.billID;
  607. joHisInfo.recordID = Global.pat.recordID;
  608. joTmp.hisInfo = joHisInfo;
  609. joTmp.psn_type = Global.pat.psn_type;
  610. joTmp.sumFeeObj = joSumFee;
  611. //0511018 {"feeObj":{"ybAmt":"医保支付","psnAcctAmt":"个人账户","psnCashAmt":"个人现金","hospAmt":"医院垫付"}}
  612. JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110018", joTmp).ToString(), "返回2207结算结果给HIS");
  613. //JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110009", joTmp).ToString(), "返回2207结算结果给HIS");
  614. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  615. {
  616. outParam = "返回2207结算结果给HIS失败,请联系管理员!" + errMsg;
  617. return -1;
  618. }
  619. else
  620. {
  621. outParam = joRtn.ToString();
  622. return 0;
  623. }
  624. }
  625. catch (Exception ex)
  626. {
  627. outParam = "返回22207结算结果给HIS出现异常:!" + ex.Message;
  628. return -1;
  629. }
  630. }
  631. /// <summary>
  632. /// 获取结算费用的封装
  633. /// </summary>
  634. /// <param name="jo"></param>
  635. /// <param name="path"></param>
  636. /// <returns></returns>
  637. private decimal getFee(JObject jo, string path)
  638. {
  639. try
  640. {
  641. string temp = JsonHelper.getDestValue(jo, path);
  642. if (temp == "")
  643. {
  644. return 0;
  645. }
  646. else
  647. {
  648. return decimal.Parse(temp);
  649. }
  650. }
  651. catch (Exception ex)
  652. {
  653. Global.writeLog("getFee异常:" + ex.Message);
  654. return 0;
  655. }
  656. }
  657. /// <summary>
  658. /// 汇总医保返回的结算金额(按照HIS的原则汇总,后期HIS按照这个来进行勾稽关系判断)
  659. /// </summary>
  660. /// <param name="jo"></param>
  661. /// <returns></returns>
  662. public int sumInsuRtnSettlInfo(JObject jo, out JObject joSumFee, out string errMsg)
  663. {
  664. // 医疗费总额是患者在医药机构花费的所有诊疗、药品、耗材、服务设施等项目费用的总和 = 基金支付总额 + 个人负担总金额 + 其他(如医院负担金额);
  665. //3、基金支付总额 = 基本医保统筹基金支出(含职工基本医疗保险、居民基本医疗保险)+补充医疗保险基金支出 (含覆盖全体参保人的居民大病保险和大额医疗费用补助、覆盖部分参保人的企业职工大额医疗费用补助和公务员医疗补助等)+医疗救助基金支出 + 其他支出(如伤残人员医疗保障基金支出);
  666. //5、个人账户支出中包含账户共济支付金额
  667. joSumFee = new JObject();
  668. errMsg = "";
  669. decimal ybAmt, psnAcctAmt, hospAmt, psnCashAmt, medFee, commercialReimamt, commercialRenflag;
  670. try
  671. {
  672. commercialRenflag = getFee(jo, "commercial_renflag"); //商保支付标志
  673. commercialReimamt = getFee(jo, "commercial_reimamt"); //商保支付金额 50
  674. if (commercialRenflag != 1)
  675. {
  676. commercialReimamt = 0;
  677. }
  678. ybAmt = getFee(jo, "hifp_pay") //基本医保统筹基金支出
  679. + getFee(jo, "hifes_pay") //企业补充医疗保险基金支出
  680. + getFee(jo, "hifmi_pay") //居民大病保险
  681. //+ getFee(jo, "hifob_pay") //大额医疗费用补助
  682. + getFee(jo, "hifob_pay") //职工大额医疗费用补助
  683. + getFee(jo, "cvlserv_pay") //公务员医疗补助
  684. + getFee(jo, "maf_pay") //医疗救助基金支出
  685. + getFee(jo, "oth_pay"); //其他支出 500
  686. psnAcctAmt = getFee(jo, "acct_pay"); //账户支付金额 100
  687. psnCashAmt = getFee(jo, "psn_cash_pay"); //现金支付金额 200
  688. hospAmt = getFee(jo, "hosp_part_amt"); //医院承担金额 0
  689. medFee = getFee(jo, "medfee_sumamt"); //总费用 800
  690. psnCashAmt = psnCashAmt - commercialReimamt; //150
  691. hospAmt = hospAmt + commercialReimamt; //50
  692. joSumFee.Add("ybAmt", ybAmt);
  693. joSumFee.Add("psnAcctAmt", psnAcctAmt);
  694. joSumFee.Add("hospAmt", hospAmt);
  695. joSumFee.Add("psnCashAmt", psnCashAmt);
  696. if (medFee != (ybAmt + psnAcctAmt + psnCashAmt + hospAmt))
  697. {
  698. errMsg = "ybAmt + psnAcctAmt + psnCashAmt + hospAmt != medFee";
  699. return -1;
  700. }
  701. return 0;
  702. }
  703. catch (Exception ex)
  704. {
  705. errMsg = ex.Message;
  706. return 1;
  707. }
  708. }
  709. /// <summary>
  710. /// 取消结算信息
  711. /// </summary>
  712. /// <param name="joParam"></param>
  713. /// <param name="outParam"></param>
  714. /// <returns></returns>
  715. public int cancleSettlementInfo(JObject joParam, out string outParam)
  716. {
  717. string errMsg;
  718. try
  719. {
  720. dynamic joTmp = new JObject();
  721. joTmp = joParam.DeepClone();
  722. joTmp.updateUserID = Global.user.ID;
  723. joTmp.middleSettleFlag = "";
  724. JObject joRtn = invoker.invokeHISService(JsonHelper.setIrisInpar("05110008", joTmp).ToString(), "取消HIS医保结算信息");
  725. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  726. {
  727. outParam = "取消HIS医保结算信息失败,请联系管理员!" + errMsg;
  728. return -1;
  729. }
  730. else
  731. {
  732. outParam = "取消HIS医保结算信息成功";
  733. return 0;
  734. }
  735. }
  736. catch (Exception ex)
  737. {
  738. outParam = "返回2304结算结果给HIS出现异常:!" + ex.Message;
  739. return -1;
  740. }
  741. }
  742. public int getHISDir(JArray jaPagination, JArray jaParams, out JObject joRtn, out string outParam)
  743. {
  744. string errMsg;
  745. joRtn = new JObject();
  746. try
  747. {
  748. dynamic joTmp = new JObject();
  749. joTmp.pagination = jaPagination;
  750. joTmp.session = Global.curEvt.jaSession;
  751. joTmp.Add("params",jaParams);
  752. joTmp.code = "05111002";
  753. joRtn = invoker.invokeHISService(joTmp.ToString(), "查询HIS目录分页");
  754. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  755. {
  756. outParam = "查询HIS目录分页失败,请联系管理员!" + errMsg;
  757. return -1;
  758. }
  759. else
  760. {
  761. if (joRtn["result"]["Data"] == null)
  762. {
  763. outParam = "Data节点不存在";
  764. return -1;
  765. }
  766. outParam = "查询HIS目录分页成功";
  767. return 0;
  768. }
  769. }
  770. catch (Exception ex)
  771. {
  772. outParam = "查询HIS目录分页异常:!" + ex.Message;
  773. return -1;
  774. }
  775. }
  776. /// <summary>
  777. /// 从HIS获取医保事前事中服务交易入参报文
  778. /// </summary>
  779. /// <param name="pat"></param>
  780. /// <param name="errMsg"></param>
  781. /// <returns></returns>
  782. public int GetInsuPatInfo(string TrigScen, Patients pat, out string outParam)
  783. {
  784. outParam = "";
  785. string errMsg;
  786. try
  787. {
  788. dynamic joIrisParam = new JObject();
  789. JArray jaIrisParams = new JArray();
  790. JObject joIrisTmp = new JObject();
  791. joIrisParam.code = "05110015";
  792. joIrisParam.session = Global.curEvt.jaSession;
  793. joIrisTmp.Add("admID", pat.adm_Dr);
  794. joIrisTmp.Add("billID", pat.billID);
  795. joIrisTmp.Add("recordID", pat.recordID);
  796. joIrisTmp.Add("userID",Global.user.ID);
  797. joIrisTmp.Add("hospID", Global.inf.hisHospitalDr);
  798. joIrisTmp.Add("psnNo", Global.pat.psn_no);
  799. joIrisTmp.Add("mdtrtId", Global.pat.mdtrtID);
  800. joIrisTmp.Add("InsuredType", Global.pat.insuType);
  801. joIrisTmp.Add("MedicalType", Global.pat.medType);
  802. joIrisTmp.Add("YBArea", Global.pat.insuplc_admdvs);
  803. joIrisTmp.Add("TrigScen", TrigScen);
  804. joIrisTmp.Add("InterfaceID", Global.inf.interfaceDr);
  805. jaIrisParams.Add(joIrisTmp);
  806. joIrisParam.Add("params", JArray.FromObject(jaIrisParams));
  807. JObject joRtn = invoker.invokeHISService(joIrisParam.ToString(), "获取HIS费用");
  808. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  809. {
  810. outParam = errMsg;
  811. return -1;
  812. }
  813. else
  814. {
  815. outParam = joRtn.ToString();
  816. return 0;
  817. }
  818. }
  819. catch (Exception ex)
  820. {
  821. outParam = "GetInsuPatInfo医保事前事中服务报文获取 异常:" + ex.Message;
  822. return -1;
  823. }
  824. }
  825. }
  826. class MIIrisServices
  827. {
  828. private InvokeHelper invoker = new InvokeHelper();
  829. public string GetCommonInterface_Dr(string interfaceID, string hospitalDr)
  830. {
  831. dynamic joParam = new JObject();
  832. joParam.HospitalDr = hospitalDr;
  833. joParam.InterfaceID = interfaceID;
  834. JObject joInparam = JsonHelper.setIrisInpar("09010003", joParam);
  835. InvokeHelper invoke = new InvokeHelper();
  836. JObject joRtn = invoke.invokeInsuService(joInparam.ToString(), "获取接口信息");
  837. JObject joInterfaceInfo = JObject.Parse(JsonHelper.getDestValue(joRtn, "result.data[0]"));
  838. if (JsonHelper.getDestValue(joInterfaceInfo, "InsuCurrencyCataLogue") != "")
  839. return JsonHelper.getDestValue(joInterfaceInfo, "InsuCurrencyCataLogue");
  840. else
  841. return interfaceID;
  842. }
  843. public JObject GetNoMappHISDir(JObject joHisRtnDir)
  844. {
  845. try
  846. {
  847. //传给医保平台,进行对照匹配
  848. dynamic joParam = new JObject();
  849. joParam.TotalCount = joHisRtnDir["result"]["TotalCount"];
  850. joParam.HospitalDr = Global.inf.hospitalDr;
  851. joParam.InterfaceDr = Global.inf.interfaceDr;
  852. joParam.Data = joHisRtnDir["result"]["Data"];
  853. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010088", joParam).ToString(), "获取未对照目录");
  854. return joRtn;
  855. }
  856. catch (Exception ex)
  857. {
  858. return JsonHelper.setExceptionJson(-1, "获取未对照目录异常:", ex.Message);
  859. }
  860. }
  861. /// <summary>
  862. /// 获取接口信息
  863. /// </summary>
  864. /// <returns></returns>
  865. public JObject getInterface()
  866. {
  867. dynamic joParam = new JObject();
  868. joParam.HospitalDr = Global.inf.hospitalDr;
  869. joParam.InterfaceID = "";
  870. JObject joInparam = JsonHelper.setIrisInpar("09010003", joParam);
  871. InvokeHelper invoker = new InvokeHelper();
  872. return invoker.invokeInsuService(joInparam.ToString(), "获取接口信息");
  873. }
  874. public JObject getInterface(string interfaceID)
  875. {
  876. dynamic joParam = new JObject();
  877. joParam.HospitalDr = Global.inf.hospitalDr;
  878. joParam.InterfaceID = interfaceID;
  879. JObject joInparam = JsonHelper.setIrisInpar("09010003", joParam);
  880. InvokeHelper invoke = new InvokeHelper();
  881. JObject joRtn = invoke.invokeInsuService(joInparam.ToString(), "获取接口信息");
  882. JObject joInterfaceInfo = JObject.Parse(JsonHelper.getDestValue(joRtn, "result.data[0]"));
  883. joInterfaceInfo.Add("operatorNO", "0");
  884. joInterfaceInfo.Add("operatorName", "管理员");
  885. return joInterfaceInfo;
  886. }
  887. public JObject getInterface_TY(string interfaceID,string hospitalDr)
  888. {
  889. dynamic joParam = new JObject();
  890. joParam.HospitalDr = hospitalDr;
  891. joParam.InterfaceID = interfaceID;
  892. JObject joInparam = JsonHelper.setIrisInpar("09010003", joParam);
  893. InvokeHelper invoke = new InvokeHelper();
  894. JObject joRtn = invoke.invokeInsuService(joInparam.ToString(), "获取接口信息");
  895. JObject joInterfaceInfo = JObject.Parse(JsonHelper.getDestValue(joRtn, "result.data[0]"));
  896. joInterfaceInfo.Add("operatorNO", "0");
  897. joInterfaceInfo.Add("operatorName", "管理员");
  898. return joInterfaceInfo;
  899. }
  900. /// <summary>
  901. /// 判断是否签到过,如果未签到,返回false,如果签到则返回ture,同时返回签到号
  902. /// </summary>
  903. /// <param name="signno"></param>
  904. /// <returns></returns>
  905. public bool isSigned(ref string signno)
  906. {
  907. JObject joIn = new JObject();
  908. joIn.Add("operatorNO", Global.user.ID.ToUpper());
  909. joIn.Add("operatorName", Global.user.name);
  910. joIn.Add("mac", Global.curEvt.mac);
  911. joIn.Add("ip", Global.curEvt.ip);
  912. joIn.Add("hospitalDr", Global.inf.hospitalDr);
  913. joIn.Add("interfaceDr", Global.inf.interfaceDr);
  914. joIn.Add("date", DateTime.Now.ToString("yyyy-MM-dd"));
  915. string data = JsonHelper.setIrisInpar("09010064", joIn).ToString();
  916. JObject joRtn = invoker.invokeInsuService(data, "查询签到信息");
  917. string errMsg = "";
  918. //MessageBox.Show("查询签到信息:"+joRtn.ToString());
  919. if (JsonHelper.parseIrisRtnValue(joRtn,out errMsg)!= 0)
  920. {
  921. signno = "";
  922. return false;
  923. }
  924. else
  925. {
  926. signno = JsonHelper.getDestValue(joRtn, "result.SignNo");
  927. return true;
  928. }
  929. }
  930. /// <summary>
  931. ///保存签到信息
  932. /// </summary>
  933. /// <param name="signno"></param>
  934. /// <returns></returns>
  935. public int saveSignRecord( string signno,out string errMsg)
  936. {
  937. if (signno == "")
  938. {
  939. errMsg = "signno不能为空!";
  940. return -1;
  941. }
  942. errMsg = ""; ;
  943. JObject joIn = new JObject();
  944. joIn.Add("operatorNO", Global.user.ID);
  945. joIn.Add("operatorName", Global.user.name);
  946. joIn.Add("mac", Global.curEvt.mac);
  947. joIn.Add("ip", Global.curEvt.ip);
  948. joIn.Add("hospitalDr", Global.inf.hospitalDr);
  949. joIn.Add("interfaceDr", Global.inf.interfaceDr);
  950. joIn.Add("date", DateTime.Now.ToString("yyyy-MM-dd"));
  951. joIn.Add("signNo", signno);
  952. joIn.Add("createTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  953. joIn.Add("division", Global.inf.areaCode);
  954. string data = JsonHelper.setIrisInpar("09010065", joIn).ToString();
  955. //MessageBox.Show("插入签到信息入参:"+ data);
  956. JObject joRtn = invoker.invokeInsuService(data, "插入签到信息");
  957. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  958. {
  959. return -1;
  960. }
  961. else
  962. {
  963. return 0;
  964. }
  965. }
  966. /// <summary>
  967. /// 保存住院登记信息
  968. /// </summary>
  969. /// <param name="joRegIn"></param>
  970. /// <param name="joRegOut"></param>
  971. /// <param name="outParam"></param>
  972. /// <returns></returns>
  973. public int saveInpatRegisterInfo(JObject joRegIn,JObject joRegOut,out string outParam)
  974. {
  975. //插入云医保平台
  976. JObject joTmp = new JObject();
  977. string errMsg = "";
  978. try
  979. {
  980. Global.pat.mdtrtcertType = JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.mdtrt_cert_type");
  981. if (Global.pat.mdtrtcertType == "01")
  982. {
  983. Global.pat.mdtrtcertType = "02";
  984. Global.pat.mdtrtcertNO = Global.pat.certNO;
  985. }
  986. else
  987. {
  988. Global.pat.mdtrtcertType = JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.mdtrt_cert_type");
  989. Global.pat.mdtrtcertNO = JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.mdtrt_cert_no");
  990. }
  991. joTmp.Add("HospitalDr", Global.inf.hospitalDr);
  992. joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
  993. joTmp.Add("AdmDr", Global.pat.adm_Dr);
  994. joTmp.Add("PatientName", Global.pat.name);
  995. joTmp.Add("PersonalNO", Global.pat.psn_no);
  996. joTmp.Add("InsuRegID", JsonHelper.getDestValue(joRegOut, "output.result.mdtrt_id"));
  997. joTmp.Add("RegDate", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.begntime"));
  998. joTmp.Add("InsuType", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.insutype"));
  999. joTmp.Add("CertificateType", Global.pat.mdtrtcertType); //JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.mdtrt_cert_type")
  1000. joTmp.Add("CertificateNO", Global.pat.mdtrtcertNO); //JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.mdtrt_cert_no")
  1001. joTmp.Add("MedicalType", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.med_type"));
  1002. joTmp.Add("AttendDoctorNO", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.atddr_no"));
  1003. joTmp.Add("ChiefPhyDocName", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.chfpdr_name"));
  1004. joTmp.Add("AdmInDiagDesc", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.adm_diag_dscr"));
  1005. joTmp.Add("AdmInDepCode", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.adm_dept_codg"));
  1006. joTmp.Add("AdmInDepName", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.adm_dept_name"));
  1007. joTmp.Add("AdmBed", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.adm_bed"));
  1008. joTmp.Add("MainDiagCode", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.dscg_maindiag_code"));
  1009. joTmp.Add("MainDiagName", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.dscg_maindiag_name"));
  1010. joTmp.Add("MainConditionDesc", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.main_cond_dscr"));
  1011. joTmp.Add("DiseasecCode", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.dise_codg"));
  1012. joTmp.Add("DiseasecName", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.dise_name"));
  1013. joTmp.Add("OperationCode", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.oprn_oprt_code"));
  1014. joTmp.Add("OperationName", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.oprn_oprt_name"));
  1015. joTmp.Add("DiseasecTypeCode", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.dise_type_code"));
  1016. joTmp.Add("InsuranceAreaCode", Global.pat.insuplc_admdvs);
  1017. joTmp.Add("TreatmentAreaCode", Global.pat.mdtrtarea_admvs);
  1018. joTmp.Add("RegState", JsonHelper.getDestValue(joRegOut, "regstate"));
  1019. joTmp.Add("ValidFlag", JsonHelper.getDestValue(joRegOut, "validflag"));
  1020. joTmp.Add("Type", JsonHelper.getDestValue(joRegOut, "type"));
  1021. joTmp.Add("updateUserID", Global.user.ID);
  1022. joTmp.Add("MSGID", Global.curEvt.msgid);
  1023. joTmp.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  1024. joTmp.Add("ConerName", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.coner_name"));
  1025. joTmp.Add("Tel", JsonHelper.getDestValue(joRegIn, "input.mdtrtinfo.tel"));
  1026. string serviceCode = "09010044";
  1027. string inpar = JsonHelper.setIrisInpar(serviceCode, joTmp).ToString();
  1028. JObject joRtn = invoker.invokeInsuService(inpar, "新增住院登记信息");
  1029. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1030. {
  1031. outParam = joRtn.ToString();
  1032. return -1;
  1033. }
  1034. else
  1035. {
  1036. outParam = joRtn.ToString();
  1037. return 0;
  1038. }
  1039. }
  1040. catch (Exception ex)
  1041. {
  1042. outParam = "保存住院登记信息异常:" + ex.Message;
  1043. return -1;
  1044. }
  1045. }
  1046. /// <summary>
  1047. /// 保存医保电子处方门诊登记信息
  1048. /// </summary>
  1049. /// <param name="jo2201Inpar"></param>
  1050. /// <param name="jo2201Rtn"></param>
  1051. /// <param name="jo2203Inpar"></param>
  1052. /// <param name="outParam"></param>
  1053. /// <returns></returns>
  1054. public int saveOutpatRegisterInfoPresCiru(JObject jo2201Inpar, JObject jo2201Rtn, JObject jo2203Inpar, out string outParam)
  1055. {
  1056. //插入云医保平台
  1057. JObject joTmp = new JObject();
  1058. string errMsg = "";
  1059. try
  1060. {
  1061. joTmp.Add("HospitalDr", Global.inf.hospitalDr);
  1062. joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
  1063. joTmp.Add("AdmDr", Global.pat.adm_Dr);
  1064. joTmp.Add("PatientName", Global.pat.name);
  1065. joTmp.Add("PersonalNO", Global.pat.psn_no);
  1066. joTmp.Add("InsuRegID", JsonHelper.getDestValue(jo2201Rtn, "output.data.mdtrt_id"));
  1067. joTmp.Add("RegDate", JsonHelper.getDestValue(jo2201Inpar, "input.data.begntime"));
  1068. joTmp.Add("InsuType", JsonHelper.getDestValue(jo2201Inpar, "input.data.insutype"));
  1069. joTmp.Add("CertificateType", JsonHelper.getDestValue(jo2201Inpar, "input.data.mdtrt_cert_type"));
  1070. joTmp.Add("CertificateNO", JsonHelper.getDestValue(jo2201Inpar, "input.data.mdtrt_cert_no"));
  1071. joTmp.Add("MedicalType", JsonHelper.getDestValue(jo2203Inpar, "input.mdtrtinfo.med_type"));
  1072. joTmp.Add("AttendDoctorNO", JsonHelper.getDestValue(jo2201Inpar, "input.data.atddr_no"));
  1073. joTmp.Add("ChiefPhyDocName", JsonHelper.getDestValue(jo2201Inpar, "input.data.dr_name"));
  1074. joTmp.Add("AdmInDiagDesc", JsonHelper.getDestValue(jo2203Inpar, "input.mdtrtinfo.main_cond_dscr"));
  1075. joTmp.Add("AdmInDepCode", JsonHelper.getDestValue(jo2201Inpar, "input.data.dept_code"));
  1076. joTmp.Add("AdmInDepName", JsonHelper.getDestValue(jo2201Inpar, "input.data.dept_name"));
  1077. joTmp.Add("AdmBed", "");
  1078. joTmp.Add("MainDiagCode", " ");
  1079. joTmp.Add("MainDiagName", " ");
  1080. joTmp.Add("MainConditionDesc", JsonHelper.getDestValue(jo2203Inpar, "input.mdtrtinfo.main_cond_dscr"));
  1081. joTmp.Add("DiseasecCode", JsonHelper.getDestValue(jo2203Inpar, "input.mdtrtinfo.dise_codg"));
  1082. joTmp.Add("DiseasecName", JsonHelper.getDestValue(jo2203Inpar, "input.mdtrtinfo.dise_name"));
  1083. joTmp.Add("OperationCode", "");
  1084. joTmp.Add("OperationName", "");
  1085. joTmp.Add("DiseasecTypeCode", "");
  1086. joTmp.Add("InsuranceAreaCode", Global.pat.insuplc_admdvs);
  1087. joTmp.Add("TreatmentAreaCode", Global.pat.mdtrtarea_admvs);
  1088. joTmp.Add("RegState", JsonHelper.getDestValue(jo2201Rtn, "regstate"));
  1089. joTmp.Add("ValidFlag", JsonHelper.getDestValue(jo2201Rtn, "validflag"));
  1090. joTmp.Add("Type", JsonHelper.getDestValue(jo2201Rtn, "type"));
  1091. joTmp.Add("updateUserID", Global.user.ID);
  1092. joTmp.Add("MSGID", Global.curEvt.msgid);
  1093. joTmp.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  1094. string serviceCode = "09010044";
  1095. string inpar = JsonHelper.setIrisInpar(serviceCode, joTmp).ToString();
  1096. JObject joRtn = invoker.invokeInsuService(inpar, "医保平台新增医保电子处方门诊登记信息");
  1097. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1098. {
  1099. outParam = joRtn.ToString();
  1100. return -1;
  1101. }
  1102. else
  1103. {
  1104. outParam = joRtn.ToString();
  1105. return 0;
  1106. }
  1107. }
  1108. catch (Exception ex)
  1109. {
  1110. outParam = "保存门诊登记信息异常:" + ex.Message;
  1111. return -1;
  1112. }
  1113. }
  1114. /// <summary>
  1115. /// 保存门诊登记信息
  1116. /// </summary>
  1117. /// <param name="jo2201Inpar"></param>
  1118. /// <param name="jo2201Rtn"></param>
  1119. /// <param name="jo2203Inpar"></param>
  1120. /// <param name="outParam"></param>
  1121. /// <returns></returns>
  1122. public int saveOutpatRegisterInfo(JObject jo2201Inpar, JObject jo2201Rtn,JObject jo2203Inpar, out string outParam)
  1123. {
  1124. //插入云医保平台
  1125. JObject joTmp = new JObject();
  1126. string errMsg = "";
  1127. try
  1128. {
  1129. joTmp.Add("HospitalDr", Global.inf.hospitalDr);
  1130. joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
  1131. joTmp.Add("AdmDr", Global.pat.adm_Dr);
  1132. joTmp.Add("PatientName", Global.pat.name);
  1133. joTmp.Add("PersonalNO", Global.pat.psn_no);
  1134. joTmp.Add("InsuRegID", JsonHelper.getDestValue(jo2201Rtn, "output.data.mdtrt_id"));
  1135. joTmp.Add("RegDate", JsonHelper.getDestValue(jo2201Inpar, "input.data.begntime"));
  1136. joTmp.Add("InsuType", JsonHelper.getDestValue(jo2201Inpar, "input.data.insutype"));
  1137. joTmp.Add("CertificateType", JsonHelper.getDestValue(jo2201Inpar, "input.data.mdtrt_cert_type"));
  1138. joTmp.Add("CertificateNO", JsonHelper.getDestValue(jo2201Inpar, "input.data.mdtrt_cert_no"));
  1139. joTmp.Add("MedicalType", JsonHelper.getDestValue(jo2203Inpar, "input.mdtrtinfo.med_type"));
  1140. joTmp.Add("AttendDoctorNO", JsonHelper.getDestValue(jo2201Inpar, "input.data.atddr_no"));
  1141. joTmp.Add("ChiefPhyDocName", JsonHelper.getDestValue(jo2201Inpar, "input.data.dr_name"));
  1142. joTmp.Add("AdmInDiagDesc", JsonHelper.getDestValue(jo2203Inpar, "input.mdtrtinfo.main_cond_dscr"));
  1143. joTmp.Add("AdmInDepCode", JsonHelper.getDestValue(jo2201Inpar, "input.data.dept_code"));
  1144. joTmp.Add("AdmInDepName", JsonHelper.getDestValue(jo2201Inpar, "input.data.dept_name"));
  1145. joTmp.Add("AdmBed", "");
  1146. joTmp.Add("MainDiagCode", " ");
  1147. joTmp.Add("MainDiagName", " ");
  1148. joTmp.Add("MainConditionDesc", JsonHelper.getDestValue(jo2203Inpar, "input.mdtrtinfo.main_cond_dscr"));
  1149. joTmp.Add("DiseasecCode", JsonHelper.getDestValue(jo2203Inpar, "input.mdtrtinfo.dise_codg"));
  1150. joTmp.Add("DiseasecName", JsonHelper.getDestValue(jo2203Inpar, "input.mdtrtinfo.dise_name"));
  1151. joTmp.Add("OperationCode", "");
  1152. joTmp.Add("OperationName", "");
  1153. joTmp.Add("DiseasecTypeCode", "");
  1154. joTmp.Add("InsuranceAreaCode", Global.pat.insuplc_admdvs);
  1155. joTmp.Add("TreatmentAreaCode", Global.pat.mdtrtarea_admvs);
  1156. joTmp.Add("RegState", JsonHelper.getDestValue(jo2201Rtn, "regstate"));
  1157. joTmp.Add("ValidFlag", JsonHelper.getDestValue(jo2201Rtn, "validflag"));
  1158. joTmp.Add("Type", JsonHelper.getDestValue(jo2201Rtn, "type"));
  1159. joTmp.Add("updateUserID", Global.user.ID);
  1160. joTmp.Add("MSGID", Global.curEvt.msgid);
  1161. joTmp.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  1162. string serviceCode = "09010044";
  1163. string inpar = JsonHelper.setIrisInpar(serviceCode, joTmp).ToString();
  1164. JObject joRtn = invoker.invokeInsuService(inpar, "新增门诊登记信息");
  1165. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1166. {
  1167. outParam = joRtn.ToString();
  1168. return -1;
  1169. }
  1170. else
  1171. {
  1172. outParam = joRtn.ToString();
  1173. return 0;
  1174. }
  1175. }
  1176. catch (Exception ex)
  1177. {
  1178. outParam = "保存门诊登记信息异常:" + ex.Message;
  1179. return -1;
  1180. }
  1181. }
  1182. /// <summary>
  1183. /// 取消登记
  1184. /// </summary>
  1185. /// <param name="type"></param>
  1186. /// <param name="outParam"></param>
  1187. /// <returns></returns>
  1188. public int cancleRegister(int type,out string outParam)
  1189. {
  1190. outParam = "";
  1191. string errMsg;
  1192. try
  1193. {
  1194. dynamic joTmp = new JObject();
  1195. joTmp.Add("HospitalDr", Global.inf.hospitalDr);
  1196. joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
  1197. joTmp.Add("AdmDr", Global.pat.adm_Dr);
  1198. joTmp.Add("PersonalNO",Global.pat.psn_no);
  1199. joTmp.Add("InsuRegID", Global.pat.mdtrtID);
  1200. joTmp.Add("CancleRegDate", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  1201. joTmp.Add("Type", type);
  1202. joTmp.Add("ValidFlag", -1);
  1203. joTmp.Add("updateUserID", Global.user.ID);
  1204. string serviceCode = "09010044";
  1205. string inpar = JsonHelper.setIrisInpar(serviceCode, joTmp).ToString();
  1206. JObject joRtn = invoker.invokeInsuService(inpar, "取消云医保平台登记信息");
  1207. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1208. {
  1209. outParam = "退结算失败,请根据输入条件检查是否存在该笔数据!" + errMsg;
  1210. return -1;
  1211. }
  1212. else
  1213. {
  1214. outParam = joRtn.ToString();
  1215. return 0;
  1216. }
  1217. }
  1218. catch (Exception ex)
  1219. {
  1220. outParam = "取消登记异常" + ":" + ex.Message;
  1221. return -1;
  1222. }
  1223. }
  1224. /// <summary>
  1225. /// 删除费用明细
  1226. /// </summary>
  1227. /// <param name="pat"></param>
  1228. /// <param name="errMsg"></param>
  1229. /// <returns></returns>
  1230. public int deleteFee(out string errMsg)
  1231. {
  1232. try
  1233. {
  1234. dynamic joTmp = new JObject();
  1235. joTmp = new JObject();
  1236. joTmp.code = "09010048";
  1237. joTmp.HospitalDr = Global.inf.hospitalDr;
  1238. joTmp.admID = Global.pat.adm_Dr;
  1239. joTmp.mdtrt_id = Global.pat.mdtrtID;
  1240. joTmp.updateUserID = Global.user.ID;
  1241. JObject joRtn = invoker.invokeInsuService(joTmp.ToString(), "删除2301明细");
  1242. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1243. {
  1244. return -1;
  1245. }
  1246. else
  1247. {
  1248. return 0;
  1249. }
  1250. }
  1251. catch (Exception ex)
  1252. {
  1253. errMsg = "deleteFee 异常:" + ex.Message;
  1254. return -1;
  1255. }
  1256. }
  1257. /// <summary>
  1258. /// 根据HIS的费用明细获取对照关系
  1259. /// </summary>
  1260. /// <returns></returns>
  1261. public int convertHisFeeWithInsuCode( JObject joHisFee, out string outParam)
  1262. {
  1263. outParam = "";
  1264. string errMsg;
  1265. try
  1266. {
  1267. JArray jaFee = JArray.FromObject(joHisFee["result"]);
  1268. JObject joTmp = JsonHelper.setIrisInpar("09010045", jaFee);
  1269. joTmp.Add("mdtrt_id", Global.pat.mdtrtID);
  1270. joTmp.Add("med_type", Global.pat.medType);
  1271. joTmp.Add("psn_no", Global.pat.psn_no);
  1272. joTmp.Add("HospitalDr", Global.inf.hospitalDr);
  1273. joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
  1274. JObject joRtn = invoker.invokeInsuService(joTmp.ToString(), "根据HIS的费用明细获取对照关系");
  1275. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1276. {
  1277. outParam = errMsg;
  1278. return -1;
  1279. }
  1280. else
  1281. {
  1282. outParam = joRtn.ToString();
  1283. return 0;
  1284. }
  1285. }
  1286. catch (Exception ex)
  1287. {
  1288. outParam = "convertHisFeeWithInsuCode 异常:" + ex.Message;
  1289. return -1;
  1290. }
  1291. }
  1292. /// <summary>
  1293. /// 插入医保费用
  1294. /// </summary>
  1295. /// <param name="jaTmp"></param>
  1296. /// <param name="outParam"></param>
  1297. /// <returns></returns>
  1298. public int insertFee(JArray jaTmp,out string outParam)
  1299. {
  1300. try
  1301. {
  1302. outParam = "";
  1303. string errMsg;
  1304. dynamic joTmp = new JObject();
  1305. joTmp = new JObject();
  1306. joTmp.code = "09010046";
  1307. joTmp.HospitalDr = Global.inf.hospitalDr;
  1308. joTmp.admID = Global.pat.adm_Dr;
  1309. joTmp.mdtrt_id = Global.pat.mdtrtID;
  1310. joTmp.updateUserID = Global.user.ID;
  1311. joTmp.Add("params", jaTmp);
  1312. ;
  1313. JObject joRtn = invoker.invokeInsuService(joTmp.ToString(), "插入2301明细");
  1314. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1315. {
  1316. outParam = errMsg;
  1317. return -1;
  1318. }
  1319. else
  1320. {
  1321. outParam = joRtn.ToString();
  1322. return 0;
  1323. }
  1324. }
  1325. catch (Exception ex)
  1326. {
  1327. outParam = "insertFee 异常:" + ex.Message;
  1328. return -1;
  1329. }
  1330. }
  1331. /// <summary>
  1332. /// 更新医保费用
  1333. /// </summary>
  1334. /// <param name="jaTmp"></param>
  1335. /// <param name="outParam"></param>
  1336. /// <returns></returns>
  1337. public int updateFee(JArray jaTmp, out string outParam)
  1338. {
  1339. try
  1340. {
  1341. outParam = "";
  1342. string errMsg;
  1343. dynamic joTmp = new JObject();
  1344. joTmp.code = "09010047";
  1345. JArray jaParams = jaTmp;
  1346. joTmp.Add("params", jaParams);
  1347. joTmp.HospitalDr = Global.inf.hospitalDr;
  1348. joTmp.admID = Global.pat.adm_Dr;
  1349. joTmp.mdtrt_id = Global.pat.mdtrtID;
  1350. joTmp.updateUserID =Global.user.ID;
  1351. JObject joRtn = invoker.invokeInsuService(joTmp.ToString(), "更新2301明细");
  1352. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1353. {
  1354. outParam = errMsg;
  1355. return -1;
  1356. }
  1357. else
  1358. {
  1359. outParam = joRtn.ToString();
  1360. return 0;
  1361. }
  1362. }
  1363. catch (Exception ex)
  1364. {
  1365. outParam = "updateFee 异常:" + ex.Message;
  1366. return -1;
  1367. }
  1368. }
  1369. /// <summary>
  1370. /// 获取各项费用汇总
  1371. /// </summary>
  1372. /// <param name="outParam"></param>
  1373. /// <returns></returns>
  1374. public int getSumFee(out string outParam)
  1375. {
  1376. try
  1377. {
  1378. outParam = "";
  1379. string errMsg;
  1380. //调用IRIS获取医保各项金额
  1381. dynamic joTmp = new JObject();
  1382. joTmp = new JObject();
  1383. joTmp.code = "09010049";
  1384. joTmp.HospitalDr = Global.inf.hospitalDr;
  1385. joTmp.admID = Global.pat.adm_Dr;
  1386. joTmp.mdtrt_id = Global.pat.mdtrtID;
  1387. joTmp.updateUserID = Global.user.ID; ;
  1388. JObject joRtn = invoker.invokeInsuService(joTmp.ToString(), "获取各项费用汇总"); ;
  1389. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1390. {
  1391. outParam = errMsg;
  1392. return -1;
  1393. }
  1394. else
  1395. {
  1396. outParam = joRtn.ToString();
  1397. return 0;
  1398. }
  1399. }
  1400. catch (Exception ex)
  1401. {
  1402. outParam = "getSumFee 异常:" + ex.Message;
  1403. return -1;
  1404. }
  1405. }
  1406. /// <summary>
  1407. /// 转换结算信息
  1408. /// </summary>
  1409. /// <param name="pat"></param>
  1410. /// <param name="joSettlement"></param>
  1411. /// <param name="outParam"></param>
  1412. /// <returns></returns>
  1413. public int convertSettlementWithInsuCode(JObject joSettlement, out string outParam)
  1414. {
  1415. outParam = "";
  1416. string errMsg;
  1417. try
  1418. {
  1419. JObject joOutput = JObject.FromObject(joSettlement["output"]);
  1420. //编码转换
  1421. JObject joInpar = new JObject();
  1422. joInpar.Add("hospitalDr", Global.inf.hospitalDr);
  1423. joInpar.Add("interfaceDr", Global.inf.interfaceDr);
  1424. joInpar.Add("output", joOutput);
  1425. InvokeHelper invoker = new InvokeHelper();
  1426. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010055", joInpar).ToString(), "结算信息编码转换");
  1427. if (JsonHelper.getDestValue(joRtn, "errorCode") != "")
  1428. {
  1429. outParam = JsonHelper.getDestValue(joRtn, "errorMessage");
  1430. return -1;
  1431. }
  1432. else
  1433. {
  1434. outParam = joRtn.ToString();
  1435. return 0;
  1436. }
  1437. }
  1438. catch (Exception ex)
  1439. {
  1440. outParam = "convertSettlementWithInsuCode 异常:" + ex.Message;
  1441. return -1;
  1442. }
  1443. }
  1444. /// <summary>
  1445. /// 插入结算信息
  1446. /// </summary>
  1447. /// <param name="joSettlement"></param>
  1448. /// <param name="outParam"></param>
  1449. /// <returns></returns>
  1450. public int saveSettlement(JObject joSettlement, out string outParam)
  1451. {
  1452. JObject joTmp = new JObject();
  1453. string errMsg = "";
  1454. try
  1455. {
  1456. JObject joSetlinfo = JObject.Parse(JsonHelper.getDestValue(joSettlement, "output.setlinfo"));
  1457. joSetlinfo.Add("HospitalDr", Global.inf.hospitalDr);
  1458. joSetlinfo.Add("HospitalDr", Global.inf.hospitalDr);
  1459. joSetlinfo.Add("HospitalDr", Global.inf.hospitalDr);
  1460. joSetlinfo.Add("admID", Global.pat.adm_Dr);
  1461. joSetlinfo.Add("ValidFlag", 1);
  1462. joSetlinfo.Add("BillType", 1);
  1463. joSetlinfo.Add("updateUserID",Global.user.ID);
  1464. joSetlinfo.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  1465. joSetlinfo.Add("billID", Global.pat.billID);
  1466. joSetlinfo.Add("recordID", Global.pat.recordID);
  1467. joSetlinfo.Add("msgid", Global.curEvt.msgid);
  1468. joSetlinfo.Add("interfaceDr", Global.inf.interfaceDr);
  1469. joSetlinfo.Add("admType", Global.pat.admType);
  1470. joSetlinfo.Add("insuplc_admdvs", Global.pat.insuplc_admdvs);
  1471. joSetlinfo.Add("HospitalizationsDays", Global.Set.hospitalizationsDays);
  1472. joSetlinfo.Add("HospitalizationsTimes", Global.Set.hospitalizationsTimes);
  1473. joSetlinfo.Add("HISAdmTime", Global.Set.hisAdmTime);
  1474. joSetlinfo.Add("HISDischargeTime", Global.Set.hisDischargeTime);
  1475. JObject joExpContent = JObject.Parse(joSetlinfo["exp_content"].ToString());
  1476. joSetlinfo.Add("medIns_wallet_balance", JsonHelper.getDestValue(joExpContent, "medIns_wallet_balance")); //医保钱包余额
  1477. joSetlinfo.Add("medIns_wallet_pay", JsonHelper.getDestValue(joExpContent, "medIns_wallet_pay")); //医保钱包支付金额
  1478. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010051", joSetlinfo).ToString(), "插入结算信息");
  1479. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1480. {
  1481. outParam = errMsg;
  1482. return -1;
  1483. }
  1484. else
  1485. {
  1486. outParam = joRtn.ToString();
  1487. return 0;
  1488. }
  1489. }
  1490. catch (Exception ex)
  1491. {
  1492. outParam = "插入结算信息:" + ex.Message;
  1493. return -1;
  1494. }
  1495. }
  1496. /// <summary>
  1497. /// 保存结算信息
  1498. /// </summary>
  1499. /// <param name="joSettlement"></param>
  1500. /// <param name="outParam"></param>
  1501. /// <returns></returns>
  1502. public int saveSettlementDetail(JObject joSettlement, out string outParam)
  1503. {
  1504. JObject joTmp = new JObject();
  1505. string errMsg = "";
  1506. try
  1507. {
  1508. JObject joSetlDetail = new JObject();
  1509. joSetlDetail.Add("HospitalDr", Global.inf.hospitalDr);
  1510. joSetlDetail.Add("InterfaceDr", Global.inf.interfaceDr);
  1511. joSetlDetail.Add("MdtrtID", Global.pat.mdtrtID);
  1512. joSetlDetail.Add("SettlementID", JsonHelper.getDestValue(joSettlement, "output.setlinfo.setl_id"));
  1513. joSetlDetail.Add("AdmID", Global.pat.adm_Dr);
  1514. joSetlDetail.Add("updateUserID", Global.user.ID);
  1515. if (JsonHelper.getDestValue(joSettlement, "output.setldetail") == "")
  1516. {
  1517. outParam = "中心返回结算明细为空!";
  1518. Global.writeLog(outParam);
  1519. return 0;
  1520. }
  1521. JArray jaSetlDetail = JArray.Parse(JsonHelper.getDestValue(joSettlement, "output.setldetail"));
  1522. joSetlDetail.Add("setldetail", jaSetlDetail);
  1523. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010056", joSetlDetail).ToString(), "插入结算明细信息");
  1524. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1525. {
  1526. outParam = errMsg;
  1527. return -1;
  1528. }
  1529. else
  1530. {
  1531. outParam = joRtn.ToString();
  1532. return 0;
  1533. }
  1534. }
  1535. catch (Exception ex)
  1536. {
  1537. outParam = "插入结算信息:" + ex.Message;
  1538. return -1;
  1539. }
  1540. }
  1541. /// <summary>
  1542. /// 取消结算
  1543. /// </summary>
  1544. /// <param name="outParam"></param>
  1545. /// <returns></returns>
  1546. public int cancleSettlement(string newSettlID, out string outParam)
  1547. {
  1548. JObject joTmp = new JObject();
  1549. string errMsg = "";
  1550. try
  1551. {
  1552. joTmp.Add("HospitalDr", Global.inf.hospitalDr);
  1553. joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
  1554. joTmp.Add("admID", Global.pat.adm_Dr);
  1555. joTmp.Add("mdtrt_id", Global.pat.mdtrtID);
  1556. joTmp.Add("setl_id", Global.pat.settlID);
  1557. joTmp.Add("new_setl_id", newSettlID);
  1558. joTmp.Add("updateUserID", Global.user.ID);
  1559. joTmp.Add("msgid", Global.curEvt.msgid);
  1560. joTmp.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  1561. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010052", joTmp).ToString(), "取消结算信息");
  1562. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1563. {
  1564. outParam = errMsg;
  1565. return -1;
  1566. }
  1567. else
  1568. {
  1569. outParam = joRtn.ToString();
  1570. return 0;
  1571. }
  1572. }
  1573. catch (Exception ex)
  1574. {
  1575. outParam = "取消结算信息:" + ex.Message;
  1576. return -1;
  1577. }
  1578. }
  1579. /// <summary>
  1580. /// 查询登记信息
  1581. /// </summary>
  1582. /// <param name="type"></param>
  1583. /// <param name="outParam"></param>
  1584. /// <returns></returns>
  1585. public int queryRegisterInfo(int type,out string outParam)
  1586. {
  1587. JObject joTmp = new JObject();
  1588. string errMsg = "";
  1589. try
  1590. {
  1591. joTmp.Add("HospitalDr", Global.inf.hospitalDr);
  1592. joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
  1593. joTmp.Add("admID", Global.pat.adm_Dr);
  1594. joTmp.Add("mdtrt_id", Global.pat.mdtrtID);
  1595. joTmp.Add("type", type);
  1596. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010050", joTmp).ToString(), "查询云平台患者登记信息");
  1597. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1598. {
  1599. outParam = errMsg;
  1600. return -1;
  1601. }
  1602. else
  1603. {
  1604. outParam = joRtn.ToString();
  1605. return 0;
  1606. }
  1607. }
  1608. catch (Exception ex)
  1609. {
  1610. outParam = "查询云平台患者登记信息:" + ex.Message;
  1611. return -1;
  1612. }
  1613. }
  1614. /// <summary>
  1615. /// 插入患者该次就诊参保信息
  1616. /// </summary>
  1617. /// <param name="joBaseInfo"></param>
  1618. /// <param name="joInsuInfo"></param>
  1619. /// <param name="joIdetInfo"></param>
  1620. /// <param name="outParam"></param>
  1621. /// <returns></returns>
  1622. public int insertPatCurInsuInfo(JObject joBaseInfo, JObject joInsuInfo, JObject joIdetInfo, out string outParam)
  1623. {
  1624. JObject joTmp = new JObject();
  1625. string errMsg = "";
  1626. try
  1627. {
  1628. joTmp.Add("HospitalDr", Global.inf.hospitalDr);
  1629. joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
  1630. joTmp.Add("AdmID", Global.pat.adm_Dr);
  1631. joTmp.Add("PatientName", Global.pat.name);
  1632. joTmp.Add("PersonalNO", Global.pat.psn_no);
  1633. joTmp.Add("MdtrtID", Global.pat.mdtrtID);
  1634. joTmp.Add("PsnCertType", JsonHelper.getDestValue(joBaseInfo, "psn_cert_type"));
  1635. joTmp.Add("PsnCertNO", JsonHelper.getDestValue(joBaseInfo, "certno"));
  1636. joTmp.Add("Gend", JsonHelper.getDestValue(joBaseInfo, "gend"));
  1637. joTmp.Add("Naty", JsonHelper.getDestValue(joBaseInfo, "naty"));
  1638. joTmp.Add("Brdy", JsonHelper.getDestValue(joBaseInfo, "brdy"));
  1639. joTmp.Add("Age", JsonHelper.getDestValue(joBaseInfo, "age"));
  1640. joTmp.Add("Balc", JsonHelper.getDestValue(joInsuInfo, "balc"));
  1641. joTmp.Add("Insutype", JsonHelper.getDestValue(joInsuInfo, "insutype"));
  1642. joTmp.Add("PsnType", JsonHelper.getDestValue(joInsuInfo, "psn_type"));
  1643. joTmp.Add("PsnInsuStas", JsonHelper.getDestValue(joInsuInfo, "psn_insu_stas"));
  1644. joTmp.Add("PsnInsuDate", JsonHelper.getDestValue(joInsuInfo, "psn_insu_date"));
  1645. joTmp.Add("PausInsuDate", JsonHelper.getDestValue(joInsuInfo, "paus_insu_date"));
  1646. joTmp.Add("Cvlservflag", JsonHelper.getDestValue(joInsuInfo, "cvlserv_flag"));
  1647. joTmp.Add("insuplcAdmdvs", JsonHelper.getDestValue(joInsuInfo, "insuplc_admdvs"));
  1648. joTmp.Add("EmpName", JsonHelper.getDestValue(joInsuInfo, "emp_name"));
  1649. joTmp.Add("PsnIdettype", JsonHelper.getDestValue(joIdetInfo, "psn_idet_type"));
  1650. joTmp.Add("PsnTypeLv", JsonHelper.getDestValue(joIdetInfo, "psn_type_lv"));
  1651. joTmp.Add("IdetBegntime", JsonHelper.getDestValue(joIdetInfo, "begntime"));
  1652. joTmp.Add("IdetEndtime", JsonHelper.getDestValue(joIdetInfo, "endtime"));
  1653. joTmp.Add("updateUserID", Global.user.ID);
  1654. Global.pat.certNO = JsonHelper.getDestValue(joBaseInfo, "certno");
  1655. string serviceCode = "09010070";
  1656. string inpar = JsonHelper.setIrisInpar(serviceCode, joTmp).ToString();
  1657. JObject joRtn = invoker.invokeInsuService(inpar, "插入患者该次就诊参保信息");
  1658. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1659. {
  1660. outParam = errMsg;
  1661. return -1;
  1662. }
  1663. else
  1664. {
  1665. outParam = joRtn.ToString();
  1666. return 0;
  1667. }
  1668. }
  1669. catch (Exception ex)
  1670. {
  1671. outParam = "医保平台插入患者该次就诊参保信息:" + ex.Message;
  1672. return -1;
  1673. }
  1674. }
  1675. #region 目录下载及对照
  1676. /// <summary>
  1677. /// 通过分页的方式查询医保目录
  1678. /// </summary>
  1679. /// <param name="currentPage"></param>
  1680. /// <param name="pageSize"></param>
  1681. /// <param name="irisCode"></param>
  1682. /// <param name="directoryType"></param>
  1683. public JObject getMIDirectoryByPagination(JObject jo)
  1684. {
  1685. string currentPage;
  1686. string pageSize;
  1687. string serviceCode;
  1688. string directoryType;
  1689. string directoryCode;
  1690. string directoryName;
  1691. string directoryDr;
  1692. string approvalNO ;
  1693. string manufacturer;
  1694. try
  1695. {
  1696. currentPage = JsonHelper.getDestValue(jo, "currentPage");
  1697. pageSize = JsonHelper.getDestValue(jo, "pageSize");
  1698. serviceCode = JsonHelper.getDestValue(jo, "serviceCode");
  1699. directoryType = JsonHelper.getDestValue(jo, "directoryType");
  1700. directoryCode = JsonHelper.getDestValue(jo, "directoryCode");
  1701. directoryName = JsonHelper.getDestValue(jo, "directoryName");
  1702. directoryDr = JsonHelper.getDestValue(jo, "directoryDr");
  1703. approvalNO = JsonHelper.getDestValue(jo, "approvalNO");
  1704. manufacturer= JsonHelper.getDestValue(jo, "manufacturer");
  1705. InvokeHelper invoker = new InvokeHelper();
  1706. dynamic joInput = new JObject();
  1707. joInput.code = serviceCode;
  1708. dynamic joTmp = new JObject();
  1709. JArray jaParmas = new JArray();
  1710. joTmp.HospitalDr = Global.inf.hospitalDr;
  1711. joTmp.InterfaceDr = directoryDr;
  1712. joTmp.Code = directoryCode;
  1713. joTmp.Name = directoryName;
  1714. joTmp.ApprovalNO = approvalNO;
  1715. joTmp.Manufacturer = manufacturer;
  1716. jaParmas.Add(joTmp);
  1717. joInput.Add("params", JArray.FromObject(jaParmas));
  1718. JArray jaPagination = new JArray();
  1719. joTmp = new JObject();
  1720. joTmp.pageSize = pageSize;
  1721. joTmp.currentPage = currentPage;
  1722. joTmp.sortColumn = "";
  1723. joTmp.sortOrder = "";
  1724. joTmp.hisType = directoryType;
  1725. jaPagination.Add(joTmp);
  1726. joInput.Add("pagination", JArray.FromObject(jaPagination));
  1727. return invoker.invokeInsuService(joInput.ToString(), "查询医保目录分页");
  1728. }
  1729. catch (Exception ex)
  1730. {
  1731. return JsonHelper.setExceptionJson(-1, "getDirectoryByPagination", ex.Message);
  1732. }
  1733. }
  1734. /// <summary>
  1735. /// 根据HisType获取当前目录最大版本号
  1736. /// </summary>
  1737. /// <param name="directoryType"></param>
  1738. /// <returns></returns>
  1739. public JObject getDirectoryMaxVersionNO(int directoryType)
  1740. {
  1741. try
  1742. {
  1743. dynamic joParam = new JObject();
  1744. joParam.HospitalDr = Global.inf.hospitalDr;
  1745. joParam.InterfaceDr = Global.inf.interfaceDr;
  1746. joParam.HisType = directoryType + 1;
  1747. JObject joInparam = JsonHelper.setIrisInpar("09010037", joParam);
  1748. JObject joRtn = invoker.invokeInsuService(joInparam.ToString(), "获取版本最大号");
  1749. return joRtn;
  1750. }
  1751. catch (Exception ex)
  1752. {
  1753. return JsonHelper.setExceptionJson(-1, "获取版本号异常:", ex.Message);
  1754. }
  1755. }
  1756. public JObject insertDictionary(JObject joData)
  1757. {
  1758. try
  1759. {
  1760. JObject joInparam = JsonHelper.setIrisInpar("09010073", joData);
  1761. JObject joRtn = invoker.invokeInsuService(joInparam.ToString(), "插入字典表");
  1762. return joRtn;
  1763. }
  1764. catch (Exception ex)
  1765. {
  1766. return JsonHelper.setExceptionJson(-1, "插入字典表异常:", ex.Message);
  1767. }
  1768. }
  1769. public JObject insertDictionaryDataDetail(JArray jaData)
  1770. {
  1771. try
  1772. {
  1773. dynamic joParam = new JObject();
  1774. joParam.HospitalDr = Global.inf.hospitalDr;
  1775. joParam.InterfaceDr = Global.inf.interfaceDr;
  1776. JObject joInparam = JsonHelper.setIrisInpar("09010074", jaData);
  1777. JObject joRtn = invoker.invokeInsuService( joInparam.ToString(),"插入字典明细表");
  1778. return joRtn;
  1779. }
  1780. catch (Exception ex)
  1781. {
  1782. return JsonHelper.setExceptionJson(-1, "插入字典明细表异常:", ex.Message);
  1783. }
  1784. }
  1785. public JObject ConvertHISDir(JObject joHisRtnDir)
  1786. {
  1787. try
  1788. {
  1789. //传给医保平台,进行对照匹配
  1790. dynamic joParam = new JObject();
  1791. joParam.TotalCount = joHisRtnDir["result"]["TotalCount"];
  1792. joParam.HospitalDr = Global.inf.hospitalDr;
  1793. joParam.InterfaceDr = Global.inf.interfaceDr;
  1794. joParam.Data = joHisRtnDir["result"]["Data"];
  1795. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010057", joParam).ToString(), "转换HIS目录分页,显示对照状态及对照的医保编码");
  1796. return joRtn;
  1797. }
  1798. catch (Exception ex)
  1799. {
  1800. return JsonHelper.setExceptionJson(-1, "转换HIS目录分页异常:", ex.Message);
  1801. }
  1802. }
  1803. /// <summary>
  1804. /// 查询单条医保对照关系-返回对照医保目录详细信息
  1805. /// </summary>
  1806. /// <param name="HISCode"></param>
  1807. /// <param name="outParam"></param>
  1808. /// <returns></returns>
  1809. public JObject queryInsuContrastDirInfo(string HISCode,int HisType)
  1810. {
  1811. try
  1812. {
  1813. dynamic joTmp = new JObject();
  1814. joTmp.Add("HospitalDr", Global.inf.hospitalDr);
  1815. joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
  1816. joTmp.Add("HisCode", HISCode);
  1817. joTmp.Add("HisType", HisType);
  1818. string serviceCode = "09010111";
  1819. string inpar = JsonHelper.setIrisInpar(serviceCode, joTmp).ToString();
  1820. JObject joRtn = invoker.invokeInsuService(inpar, "获取HIS医保对照信息");
  1821. return joRtn;
  1822. }
  1823. catch (Exception ex)
  1824. {
  1825. return JsonHelper.setExceptionJson(-1, "获取HIS医保对照信息异常:", ex.Message);
  1826. }
  1827. }
  1828. public JObject GetMappedHISDir(JArray jaPagination, JArray jaParams)
  1829. {
  1830. try
  1831. {
  1832. //传给医保平台,进行对照匹配
  1833. dynamic joParam = new JObject();
  1834. joParam.pagination = jaPagination;
  1835. joParam.session = Global.curEvt.jaSession;
  1836. joParam.Add("params", jaParams);
  1837. joParam.code = "09010058";
  1838. JObject joRtn = invoker.invokeInsuService(joParam.ToString(), "获取已对照目录分页");
  1839. return joRtn;
  1840. }
  1841. catch (Exception ex)
  1842. {
  1843. return JsonHelper.setExceptionJson(-1, "获取已对照目录分页异常:", ex.Message);
  1844. }
  1845. }
  1846. public JObject UpdateDirectoryBySelf(JObject joIn)
  1847. {
  1848. try
  1849. {
  1850. //查询区域通用目录
  1851. MIIrisServices mIS = new MIIrisServices();
  1852. JObject joRtnTY = mIS.getInterface_TY(Global.inf.interfaceDr.ToString(), "");
  1853. string InsuCurrencyCataLogue = JsonHelper.getDestValue(joRtnTY, "InsuCurrencyCataLogue"); //通用目录编码 6
  1854. string InterfaceName_TY = JsonHelper.getDestValue(joRtnTY, "InterfaceName_TY"); //通用目录接口名称
  1855. string HospName_TY = JsonHelper.getDestValue(joRtnTY, "HospitalName"); //通用目录所属医院名称
  1856. string HospitalDr_TY = JsonHelper.getDestValue(joRtnTY, "HospitalDr_TY"); //通用目录所属医院ID
  1857. JObject joParam = (JObject)joIn.DeepClone();
  1858. if ((InsuCurrencyCataLogue != "") && (HospitalDr_TY != ""))
  1859. {
  1860. joParam.Add("updateUserID", Global.user.ID);
  1861. joParam.Add("HospitalDr", HospitalDr_TY);
  1862. joParam.Add("InterfaceDr", InsuCurrencyCataLogue);
  1863. }
  1864. else
  1865. {
  1866. joParam.Add("updateUserID", Global.user.ID);
  1867. joParam.Add("HospitalDr", Global.inf.hospitalDr);
  1868. joParam.Add("InterfaceDr", Global.inf.interfaceDr);
  1869. }
  1870. InvokeHelper invoker = new InvokeHelper();
  1871. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010035", joParam).ToString(), "手动修改医保目录表");
  1872. return joRtn;
  1873. }
  1874. catch (Exception ex)
  1875. {
  1876. return JsonHelper.setExceptionJson(-1, "手动修改医保目录表异常:", ex.Message);
  1877. }
  1878. }
  1879. public JObject QueryTransactionLog(JObject joSqlStr)
  1880. {
  1881. try
  1882. {
  1883. InvokeHelper invoker = new InvokeHelper();
  1884. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010060", joSqlStr).ToString(), "查询交易日志(冲正)");
  1885. return joRtn;
  1886. }
  1887. catch (Exception ex)
  1888. {
  1889. return JsonHelper.setExceptionJson(-1, "查询交易日志(冲正)异常:", ex.Message);
  1890. }
  1891. }
  1892. public JObject QuerySettlementInfo(JObject joSqlStr)
  1893. {
  1894. try
  1895. {
  1896. InvokeHelper invoker = new InvokeHelper();
  1897. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010059", joSqlStr).ToString(), "查询结算信息");
  1898. return joRtn;
  1899. }
  1900. catch (Exception ex)
  1901. {
  1902. return JsonHelper.setExceptionJson(-1, "查询交易日志(冲正)异常:", ex.Message);
  1903. }
  1904. }
  1905. #endregion
  1906. #region【医保移动支付】
  1907. /// <summary>
  1908. /// 根据HIS的费用明细获取对照关系
  1909. /// </summary>
  1910. /// <returns></returns>
  1911. public int convertHisFeeWithInsuCodeOfMobilePay(Patients pat, JObject joHisFee, out string outParam)
  1912. {
  1913. outParam = "";
  1914. string errMsg;
  1915. try
  1916. {
  1917. JArray jaFee = JArray.FromObject(joHisFee["result"]);
  1918. JObject joTmp = JsonHelper.setIrisInpar("09010086", jaFee);
  1919. joTmp.Add("mdtrt_id", pat.mdtrtID);
  1920. joTmp.Add("med_type", pat.medType);
  1921. joTmp.Add("psn_no", pat.psn_no);
  1922. joTmp.Add("HospitalDr", Global.inf.hospitalDr);
  1923. joTmp.Add("InterfaceDr", Global.inf.interfaceDr);
  1924. JObject joRtn = invoker.invokeInsuService(joTmp.ToString(), "根据HIS的费用明细获取对照关系");
  1925. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  1926. {
  1927. outParam = errMsg;
  1928. return -1;
  1929. }
  1930. else
  1931. {
  1932. outParam = joRtn.ToString();
  1933. return 0;
  1934. }
  1935. }
  1936. catch (Exception ex)
  1937. {
  1938. outParam = " convertHisFeeWithInsuCodeOfMobilePay异常:" + ex.Message;
  1939. return -1;
  1940. }
  1941. }
  1942. public JObject DynamicQuerySettlInfo(JObject joSqlStr)
  1943. {
  1944. try
  1945. {
  1946. InvokeHelper invoker = new InvokeHelper();
  1947. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010081", joSqlStr).ToString(), "动态查询结算信息");
  1948. return joRtn;
  1949. }
  1950. catch (Exception ex)
  1951. {
  1952. return JsonHelper.setExceptionJson(-1, "查询结算信息异常:", ex.Message);
  1953. }
  1954. }
  1955. #endregion
  1956. #region【医保电子处方流转】
  1957. /// <summary>
  1958. /// 插入电子处方上传预核验
  1959. /// </summary>
  1960. /// <param name="joBaseInfo"></param>
  1961. /// <param name="joInsuInfo"></param>
  1962. /// <param name="joIdetInfo"></param>
  1963. /// <param name="outParam"></param>
  1964. /// <returns></returns>
  1965. public int InsertPreCheck(JObject joInput, JObject joOutput, out string outParam)
  1966. {
  1967. JObject joTmp = new JObject();
  1968. string errMsg = "";
  1969. try
  1970. {
  1971. joTmp.Add("Hospital_Dr", Global.inf.hospitalDr);
  1972. joTmp.Add("Interface_Dr", Global.inf.interfaceDr);
  1973. joTmp.Add("MdtrtID", JsonHelper.getDestValue(joInput, "mdtrtID"));
  1974. joTmp.Add("Adm_Dr", Global.pat.adm_Dr);
  1975. joTmp.Add("HospRxno", JsonHelper.getDestValue(joInput, "hospRxno"));
  1976. joTmp.Add("MdtrtCertType", JsonHelper.getDestValue(joInput, "mdtrtCertType"));
  1977. joTmp.Add("MdtrtCertNo", JsonHelper.getDestValue(joInput, "mdtrtCertNo"));
  1978. joTmp.Add("InsuPlcNo", JsonHelper.getDestValue(joInput, "insuPlcNo"));
  1979. joTmp.Add("InitRxno", JsonHelper.getDestValue(joInput, "initRxno"));
  1980. joTmp.Add("RxTypeCode", JsonHelper.getDestValue(joInput, "rxTypeCode"));
  1981. joTmp.Add("PrscTime", JsonHelper.getDestValue(joInput, "prscTime"));
  1982. joTmp.Add("RxDrugCnt", JsonHelper.getDestValue(joInput, "rxDrugCnt"));
  1983. joTmp.Add("ValiDays", JsonHelper.getDestValue(joInput, "valiDays"));
  1984. joTmp.Add("ValiEndTime", JsonHelper.getDestValue(joInput, "valiEndTime"));
  1985. joTmp.Add("IptOtpNo", JsonHelper.getDestValue(joInput, "iptOtpNo"));
  1986. joTmp.Add("OtpIptFlag", JsonHelper.getDestValue(joInput, "otpIptFlag"));
  1987. joTmp.Add("PsnNo", JsonHelper.getDestValue(joInput, "psnNo"));
  1988. joTmp.Add("PatnName", JsonHelper.getDestValue(joInput, "patnName"));
  1989. joTmp.Add("PsnCertType", JsonHelper.getDestValue(joInput, "psnCertType"));
  1990. joTmp.Add("Certno", JsonHelper.getDestValue(joInput, "certno"));
  1991. joTmp.Add("PatnAge", JsonHelper.getDestValue(joInput, "patnAge"));
  1992. joTmp.Add("Gend", JsonHelper.getDestValue(joInput, "gend"));
  1993. joTmp.Add("PrscDeptName", JsonHelper.getDestValue(joInput, "prscDeptName"));
  1994. joTmp.Add("PrscDeptCode", JsonHelper.getDestValue(joInput, "prscDeptCode"));
  1995. joTmp.Add("DrCode", JsonHelper.getDestValue(joInput, "drCode"));
  1996. joTmp.Add("PrscDrName", JsonHelper.getDestValue(joInput, "prscDrName"));
  1997. joTmp.Add("DrProfttlCodg", JsonHelper.getDestValue(joInput, "drProfttlCodg"));
  1998. joTmp.Add("DrProfttlName", JsonHelper.getDestValue(joInput, "drProfttlName"));
  1999. joTmp.Add("MdtrtTime", JsonHelper.getDestValue(joInput, "mdtrtTime"));
  2000. joTmp.Add("DiseCodg", JsonHelper.getDestValue(joInput, "diseCodg"));
  2001. joTmp.Add("DiseName", JsonHelper.getDestValue(joInput, "diseName"));
  2002. joTmp.Add("SpDiseFlag", JsonHelper.getDestValue(joInput, "spDiseFlag"));
  2003. joTmp.Add("MaindiagCode", JsonHelper.getDestValue(joInput, "maindiagCode"));
  2004. joTmp.Add("MaindiagName", JsonHelper.getDestValue(joInput, "maindiagName"));
  2005. joTmp.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  2006. joTmp.Add("RxTraceCode", JsonHelper.getDestValue(joOutput, "rxTraceCode"));
  2007. joTmp.Add("HiRxno", JsonHelper.getDestValue(joOutput, "hiRxno"));
  2008. joTmp.Add("UpdateUserID", Global.user.name);
  2009. string serviceCode = "09010096";
  2010. string inpar = JsonHelper.setIrisInpar(serviceCode, joTmp).ToString();
  2011. JObject joRtn = invoker.invokeInsuService(inpar, "插入电子处方上传预核验信息");
  2012. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  2013. {
  2014. outParam = errMsg;
  2015. return -1;
  2016. }
  2017. else
  2018. {
  2019. outParam = joRtn.ToString();
  2020. return 0;
  2021. }
  2022. }
  2023. catch (Exception ex)
  2024. {
  2025. outParam = "医保平台插入电子处方上传预核验信息:" + ex.Message;
  2026. return -1;
  2027. }
  2028. }
  2029. /// <summary>
  2030. /// 插入电子处方医保电子签名信息
  2031. /// </summary>
  2032. /// <param name="joBaseInfo"></param>
  2033. /// <param name="joInsuInfo"></param>
  2034. /// <param name="joIdetInfo"></param>
  2035. /// <param name="outParam"></param>
  2036. /// <returns></returns>
  2037. public int InsertElectronicSignature(JObject joInput, JObject joOutput, out string outParam)
  2038. {
  2039. JObject joTmp = new JObject();
  2040. string errMsg = "";
  2041. try
  2042. {
  2043. joTmp.Add("Hospital_Dr", Global.inf.hospitalDr);
  2044. joTmp.Add("Interface_Dr", Global.inf.interfaceDr);
  2045. joTmp.Add("MdtrtID", JsonHelper.getDestValue(joInput, "mdtrtID"));
  2046. joTmp.Add("Adm_Dr", Global.pat.adm_Dr);
  2047. joTmp.Add("FixmedinsCode", JsonHelper.getDestValue(joInput, "fixmedinsCode"));
  2048. joTmp.Add("HospRxno", JsonHelper.getDestValue(joInput, "hospRxno"));
  2049. joTmp.Add("IptOtpNo", JsonHelper.getDestValue(joInput, "iptOtpNo"));
  2050. joTmp.Add("OriginalValue", JsonHelper.getDestValue(joInput, "originalValue"));
  2051. joTmp.Add("OriginalRxFile", JsonHelper.getDestValue(joInput, "originalRxFile"));
  2052. joTmp.Add("Extras", JsonHelper.getDestValue(joInput, "extras"));
  2053. joTmp.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  2054. joTmp.Add("RxFile", JsonHelper.getDestValue(joOutput, "rxFile"));
  2055. joTmp.Add("SignDigest", JsonHelper.getDestValue(joOutput, "signDigest"));
  2056. joTmp.Add("SignCertSn", JsonHelper.getDestValue(joOutput, "signCertSn"));
  2057. joTmp.Add("SignCertDn", JsonHelper.getDestValue(joOutput, "signCertDn"));
  2058. joTmp.Add("UpdateUserID", Global.user.name);
  2059. string serviceCode = "09010097";
  2060. string inpar = JsonHelper.setIrisInpar(serviceCode, joTmp).ToString();
  2061. JObject joRtn = invoker.invokeInsuService(inpar, "插入电子处方医保电子签名信息");
  2062. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  2063. {
  2064. outParam = errMsg;
  2065. return -1;
  2066. }
  2067. else
  2068. {
  2069. outParam = joRtn.ToString();
  2070. return 0;
  2071. }
  2072. }
  2073. catch (Exception ex)
  2074. {
  2075. outParam = "医保平台插入电子处方医保电子签名信息:" + ex.Message;
  2076. return -1;
  2077. }
  2078. }
  2079. /// <summary>
  2080. /// 插入电子处方上传信息
  2081. /// </summary>
  2082. /// <param name="joBaseInfo"></param>
  2083. /// <param name="joInsuInfo"></param>
  2084. /// <param name="joIdetInfo"></param>
  2085. /// <param name="outParam"></param>
  2086. /// <returns></returns>
  2087. public int InsertUploadRecord(JObject joInput, JObject joOutput, out string outParam)
  2088. {
  2089. JObject joTmp = new JObject();
  2090. string errMsg = "";
  2091. try
  2092. {
  2093. joTmp.Add("Hospital_Dr", Global.inf.hospitalDr);
  2094. joTmp.Add("Interface_Dr", Global.inf.interfaceDr);
  2095. joTmp.Add("MdtrtID", JsonHelper.getDestValue(joInput, "mdtrtID"));
  2096. joTmp.Add("Adm_Dr", Global.pat.adm_Dr);
  2097. joTmp.Add("HiRxno", JsonHelper.getDestValue(joInput, "hiRxno"));
  2098. joTmp.Add("RxTraceCode", JsonHelper.getDestValue(joInput, "rxTraceCode"));
  2099. joTmp.Add("PatnName", JsonHelper.getDestValue(joInput, "patnName"));
  2100. joTmp.Add("PsnCertType", JsonHelper.getDestValue(joInput, "psnCertType"));
  2101. joTmp.Add("Certno", JsonHelper.getDestValue(joInput, "certno"));
  2102. joTmp.Add("FixmedinsName", JsonHelper.getDestValue(joInput, "fixmedinsName"));
  2103. joTmp.Add("FixmedinsCode", JsonHelper.getDestValue(joInput, "fixmedinsCode"));
  2104. joTmp.Add("FrCode", JsonHelper.getDestValue(joInput, "frCode"));
  2105. joTmp.Add("PrscDrName", JsonHelper.getDestValue(joInput, "prscDrName"));
  2106. joTmp.Add("PharDeptName", JsonHelper.getDestValue(joInput, "pharDeptName"));
  2107. joTmp.Add("PharDeptCode", JsonHelper.getDestValue(joInput, "pharDeptCode"));
  2108. joTmp.Add("PharCode", JsonHelper.getDestValue(joInput, "pharCode"));
  2109. joTmp.Add("PharName", JsonHelper.getDestValue(joInput, "pharName"));
  2110. joTmp.Add("PharChkTime", JsonHelper.getDestValue(joInput, "pharChkTime"));
  2111. joTmp.Add("RxFile", JsonHelper.getDestValue(joInput, "rxFile"));
  2112. joTmp.Add("SignDigest", JsonHelper.getDestValue(joInput, "signDigest"));
  2113. joTmp.Add("Extras", JsonHelper.getDestValue(joInput, "extras"));
  2114. joTmp.Add("RxStasCodg", JsonHelper.getDestValue(joOutput, "rxStasCodg"));
  2115. joTmp.Add("RxStasName", JsonHelper.getDestValue(joOutput, "rxStasName"));
  2116. joTmp.Add("Upload", "Y");
  2117. joTmp.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  2118. joTmp.Add("UpdateUserID", Global.user.name);
  2119. string serviceCode = "09010098";
  2120. string inpar = JsonHelper.setIrisInpar(serviceCode, joTmp).ToString();
  2121. JObject joRtn = invoker.invokeInsuService(inpar, "插入电子处方上传信息");
  2122. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  2123. {
  2124. outParam = errMsg;
  2125. return -1;
  2126. }
  2127. else
  2128. {
  2129. outParam = joRtn.ToString();
  2130. return 0;
  2131. }
  2132. }
  2133. catch (Exception ex)
  2134. {
  2135. outParam = "医保平台插入电子处方上传信息:" + ex.Message;
  2136. return -1;
  2137. }
  2138. }
  2139. /// <summary>
  2140. /// 通过医保处方编号更新处方上传信息
  2141. /// </summary>
  2142. /// <param name="newSettlID"></param>
  2143. /// <param name="outParam"></param>
  2144. /// <returns></returns>
  2145. public int CancelUploadRecord(string mdtrtID, JObject joOutput, out string outParam)
  2146. {
  2147. JObject joTmp = new JObject();
  2148. string errMsg = "";
  2149. try
  2150. {
  2151. joTmp.Add("Hospital_Dr", Global.inf.hospitalDr);
  2152. joTmp.Add("Interface_Dr", Global.inf.interfaceDr);
  2153. joTmp.Add("MdtrtID", mdtrtID);
  2154. joTmp.Add("Adm_Dr", Global.pat.adm_Dr);
  2155. joTmp.Add("HiRxno", JsonHelper.getDestValue(joOutput, "hiRxno"));
  2156. joTmp.Add("RxStasCodg", JsonHelper.getDestValue(joOutput, "rxStasCodg"));
  2157. joTmp.Add("RxStasName", JsonHelper.getDestValue(joOutput, "rxStasName"));
  2158. joTmp.Add("Upload", "N");
  2159. joTmp.Add("OccurTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  2160. joTmp.Add("UpdateUserID", Global.user.name);
  2161. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010099", joTmp).ToString(), "通过医保处方编号更新处方上传信息");
  2162. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  2163. {
  2164. outParam = errMsg;
  2165. return -1;
  2166. }
  2167. else
  2168. {
  2169. outParam = joRtn.ToString();
  2170. return 0;
  2171. }
  2172. }
  2173. catch (Exception ex)
  2174. {
  2175. outParam = "通过医保处方编号更新处方上传信息:" + ex.Message;
  2176. return -1;
  2177. }
  2178. }
  2179. /// <summary>
  2180. /// 查询电子处方预核验信息
  2181. /// </summary>
  2182. /// <param name="HospRxNo"></param>
  2183. /// <param name="joRtnInfo"></param>
  2184. /// <param name="OutMsg"></param>
  2185. /// <returns></returns>
  2186. public int GetPresCirPreCheckInfo(string HospRxNo, out string OutMsg)
  2187. {
  2188. string sqlStr = " SELECT * FROM BS_MedInsuPresCiruUploadPreCheck ";
  2189. sqlStr = sqlStr + " WHERE Hospital_Dr=" + Global.inf.hospitalDr;
  2190. sqlStr = sqlStr + " and Interface_Dr= " + Global.inf.interfaceDr;
  2191. sqlStr = sqlStr + " and HospRxno='" + HospRxNo + "'";
  2192. sqlStr = sqlStr + " and Adm_Dr=" + Global.pat.adm_Dr;
  2193. JObject joSqlstr = new JObject();
  2194. joSqlstr.Add("sqlStr", sqlStr);
  2195. JArray jaParam = new JArray();
  2196. jaParam.Add(joSqlstr);
  2197. JObject joSettlQuery = new JObject();
  2198. joSettlQuery.Add("params", jaParam);
  2199. joSettlQuery.Add("code", "09010101");
  2200. JObject joRtn = invoker.invokeInsuService(joSettlQuery.ToString(), "查询电子处方上传预核验信息");
  2201. OutMsg = joRtn["result"]["dataSingle"].ToString();
  2202. //DataTable dd = (DataTable)joRtn["result"]["data"].ToObject(typeof(DataTable));
  2203. return 0;
  2204. }
  2205. /// <summary>
  2206. /// 查询电子处方电子签名信息
  2207. /// </summary>
  2208. /// <param name="HospRxNo"></param>
  2209. /// <param name="joRtnInfo"></param>
  2210. /// <param name="OutMsg"></param>
  2211. /// <returns></returns>
  2212. public int GetPresCirElectronicSignatureInfo(string HospRxNo, out string OutMsg)
  2213. {
  2214. string sqlStr = " SELECT * FROM BS_MedInsuPresCiruElectronicSignature ";
  2215. sqlStr = sqlStr + " WHERE Hospital_Dr=" + Global.inf.hospitalDr;
  2216. sqlStr = sqlStr + " and Interface_Dr= " + Global.inf.interfaceDr;
  2217. sqlStr = sqlStr + " and HospRxno='" + HospRxNo + "'";
  2218. sqlStr = sqlStr + " and Adm_Dr=" + Global.pat.adm_Dr;
  2219. JObject joSqlstr = new JObject();
  2220. joSqlstr.Add("sqlStr", sqlStr);
  2221. JArray jaParam = new JArray();
  2222. jaParam.Add(joSqlstr);
  2223. JObject joSettlQuery = new JObject();
  2224. joSettlQuery.Add("params", jaParam);
  2225. joSettlQuery.Add("code", "09010102");
  2226. JObject joRtn = invoker.invokeInsuService(joSettlQuery.ToString(), "查询电子处方电子签名信息");
  2227. OutMsg = joRtn["result"]["data"].ToString();
  2228. //DataTable dd = (DataTable)joRtn["result"]["data"].ToObject(typeof(DataTable));
  2229. return 0;
  2230. }
  2231. /// <summary>
  2232. /// 查询电子处方上传信息
  2233. /// </summary>
  2234. /// <param name="HospRxNo"></param>
  2235. /// <param name="joRtnInfo"></param>
  2236. /// <param name="OutMsg"></param>
  2237. /// <returns></returns>
  2238. public int GetPresCirUploadRecordInfo(string HospRxNo, out string OutMsg)
  2239. {
  2240. string sqlStr = " SELECT * FROM BS_MedInsuPresCiruUploadRecord ";
  2241. sqlStr = sqlStr + " WHERE Upload=Y And Hospital_Dr=" + Global.inf.hospitalDr;
  2242. sqlStr = sqlStr + " and Interface_Dr= " + Global.inf.interfaceDr;
  2243. sqlStr = sqlStr + " and HospRxno='" + HospRxNo + "'";
  2244. sqlStr = sqlStr + " and Adm_Dr=" + Global.pat.adm_Dr;
  2245. JObject joSqlstr = new JObject();
  2246. joSqlstr.Add("sqlStr", sqlStr);
  2247. JArray jaParam = new JArray();
  2248. jaParam.Add(joSqlstr);
  2249. JObject joSettlQuery = new JObject();
  2250. joSettlQuery.Add("params", jaParam);
  2251. joSettlQuery.Add("code", "09010100");
  2252. JObject joRtn = invoker.invokeInsuService(joSettlQuery.ToString(), "查询电子处方上传信息");
  2253. OutMsg = joRtn["result"]["data"].ToString();
  2254. //DataTable dd = (DataTable)joRtn["result"]["data"].ToObject(typeof(DataTable));
  2255. return 0;
  2256. }
  2257. /// <summary>
  2258. /// 撤销医保电子处方上传成功后更新IRIS表
  2259. /// </summary>
  2260. /// <param name="JoInput"></param>
  2261. /// <param name="ID"></param>
  2262. /// <param name="HiRxno"></param>
  2263. /// <param name="FixmedinsCode"></param>
  2264. /// <param name="CancelReason"></param>
  2265. /// <param name="OutMsg"></param>
  2266. /// <returns></returns>
  2267. public int cancelPresCirUpload(JObject JoRtn, string ID, string HiRxno, string FixmedinsCode, string CancelReason, string DrInsuCode, string DrName, string DrCertNo, out string OutMsg)
  2268. {
  2269. string errMsg = "";
  2270. try
  2271. {
  2272. JObject joInParam = new JObject();
  2273. joInParam.Add("ID", ID);
  2274. joInParam.Add("HiRxno", HiRxno);
  2275. joInParam.Add("FixmedinsCode", FixmedinsCode);
  2276. joInParam.Add("UndoDrCode", DrInsuCode);
  2277. joInParam.Add("UndoDrName", DrName);
  2278. joInParam.Add("UndoDrCertType", "01");
  2279. joInParam.Add("UndoDrCertno", DrCertNo);
  2280. joInParam.Add("UndoRea", CancelReason);
  2281. joInParam.Add("UndoTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
  2282. joInParam.Add("RxStasCodg", JsonHelper.getDestValue(JoRtn, "rxStasCodg")); //医保处方状态编码
  2283. joInParam.Add("RxStasName", JsonHelper.getDestValue(JoRtn, "rxStasName")); //医保处方状态名称
  2284. joInParam.Add("Upload", "N");
  2285. joInParam.Add("updateUserID", Global.user.ID);
  2286. joInParam.Add("Type", "Cancel");
  2287. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010099", joInParam).ToString(), "撤销电子处方上传信息");
  2288. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  2289. {
  2290. OutMsg = errMsg;
  2291. return -1;
  2292. }
  2293. else
  2294. {
  2295. OutMsg = joRtn.ToString();
  2296. return 0;
  2297. }
  2298. }
  2299. catch (Exception ex)
  2300. {
  2301. OutMsg = "撤销电子处方上传信息:" + ex.Message;
  2302. return -1;
  2303. }
  2304. }
  2305. /// <summary>
  2306. /// 撤销医保电子处方上传成功后更新IRIS表
  2307. /// </summary>
  2308. /// <param name="JoInput"></param>
  2309. /// <param name="ID"></param>
  2310. /// <param name="HiRxno"></param>
  2311. /// <param name="FixmedinsCode"></param>
  2312. /// <param name="CancelReason"></param>
  2313. /// <param name="OutMsg"></param>
  2314. /// <returns></returns>
  2315. public int UpdatePresCirUpload(JObject JoRtn, string ID, out string OutMsg)
  2316. {
  2317. string errMsg = "";
  2318. try
  2319. {
  2320. JObject joInParam = new JObject();
  2321. joInParam.Add("ID", ID);
  2322. joInParam.Add("HiRxno", JsonHelper.getDestValue(JoRtn, "hiRxno"));
  2323. joInParam.Add("RxChkStasCodg", JsonHelper.getDestValue(JoRtn, "rxChkStasCodg")); //处方审核状态代码
  2324. joInParam.Add("RxChkStasName", JsonHelper.getDestValue(JoRtn, "rxChkStasName")); //处方审核状态
  2325. joInParam.Add("RxChkOpnn", JsonHelper.getDestValue(JoRtn, "rxChkOpnn")); //处方审核意见
  2326. joInParam.Add("RxChkTime", JsonHelper.getDestValue(JoRtn, "RxChkTime")); //处方审核时间
  2327. joInParam.Add("RxStasCodg", JsonHelper.getDestValue(JoRtn, "rxStasCodg")); //处方审核时间
  2328. joInParam.Add("RxStasName", JsonHelper.getDestValue(JoRtn, "rxStasName")); //处方审核时间
  2329. joInParam.Add("UpdateUserID", Global.user.ID);
  2330. joInParam.Add("Type", "Update");
  2331. JObject joRtn = invoker.invokeInsuService(JsonHelper.setIrisInpar("09010099", joInParam).ToString(), "更新电子处方上传信息");
  2332. if (JsonHelper.parseIrisRtnValue(joRtn, out errMsg) != 0)
  2333. {
  2334. OutMsg = errMsg;
  2335. return -1;
  2336. }
  2337. else
  2338. {
  2339. OutMsg = joRtn.ToString();
  2340. return 0;
  2341. }
  2342. }
  2343. catch (Exception ex)
  2344. {
  2345. OutMsg = "更新电子处方上传信息:" + ex.Message;
  2346. return -1;
  2347. }
  2348. }
  2349. #endregion
  2350. }
  2351. }